<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-

The overall structure of the GHC Prelude is a bit tricky.

  a) We want to avoid &quot;orphan modules&quot;, i.e. ones with instance
        decls that don't belong either to a tycon or a class
        defined in the same module

  b) We want to avoid giant modules

So the rough structure is as follows, in (linearised) dependency order


GHC.Prim        Has no implementation.  It defines built-in things, and
                by importing it you bring them into scope.
                The source file is GHC.Prim.hi-boot, which is just
                copied to make GHC.Prim.hi

GHC.Base        Classes: Eq, Ord, Functor, Monad
                Types:   list, (), Int, Bool, Ordering, Char, String

Data.Tuple      Types: tuples, plus instances for GHC.Base classes

GHC.Show        Class: Show, plus instances for GHC.Base/GHC.Tup types

GHC.Enum        Class: Enum,  plus instances for GHC.Base/GHC.Tup types

Data.Maybe      Type: Maybe, plus instances for GHC.Base classes

GHC.List        List functions

GHC.Num         Class: Num, plus instances for Int
                Type:  Integer, plus instances for all classes so far (Eq, Ord, Num, Show)

                Integer is needed here because it is mentioned in the signature
                of 'fromInteger' in class Num

GHC.Real        Classes: Real, Integral, Fractional, RealFrac
                         plus instances for Int, Integer
                Types:  Ratio, Rational
                        plus instances for classes so far

                Rational is needed here because it is mentioned in the signature
                of 'toRational' in class Real

GHC.ST  The ST monad, instances and a few helper functions

Ix              Classes: Ix, plus instances for Int, Bool, Char, Integer, Ordering, tuples

GHC.Arr         Types: Array, MutableArray, MutableVar

                Arrays are used by a function in GHC.Float

GHC.Float       Classes: Floating, RealFloat
                Types:   Float, Double, plus instances of all classes so far

                This module contains everything to do with floating point.
                It is a big module (900 lines)
                With a bit of luck, many modules can be compiled without ever reading GHC.Float.hi


Other Prelude modules are much easier with fewer complex dependencies.
-}</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-pragma">{-# LANGUAGE Unsafe #-}</span><span>
</span><span id="line-66"></span><span class="hs-pragma">{-# LANGUAGE CPP
           , NoImplicitPrelude
           , BangPatterns
           , ExplicitForAll
           , MagicHash
           , UnboxedTuples
           , ExistentialQuantification
           , RankNTypes
           , KindSignatures
           , PolyKinds
           , DataKinds
  #-}</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- -Wno-orphans is needed for things like:</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- Orphan rule: &quot;x# -# x#&quot; ALWAYS forall x# :: Int# -# x# x# = 0</span><span>
</span><span id="line-80"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-orphans #-}</span><span>
</span><span id="line-81"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-85"></span><span class="hs-comment">-- Module      :  GHC.Base</span><span>
</span><span id="line-86"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow, 1992-2002</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-88"></span><span class="hs-comment">--</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- Maintainer  :  cvs-ghc@haskell.org</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-91"></span><span class="hs-comment">-- Portability :  non-portable (GHC extensions)</span><span>
</span><span id="line-92"></span><span class="hs-comment">--</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- Basic data types and classes.</span><span>
</span><span id="line-94"></span><span class="hs-comment">--</span><span>
</span><span id="line-95"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span class="hs-cpp">

#include &quot;MachDeps.h&quot;
</span><span>
</span><span id="line-99"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Base</span><span>
</span><span id="line-100"></span><span>        </span><span class="hs-special">(</span><span>
</span><span id="line-101"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#"><span class="hs-identifier">GHC.Classes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-103"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#"><span class="hs-identifier">GHC.CString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Magic.html#"><span class="hs-identifier">GHC.Magic</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#"><span class="hs-identifier">GHC.Types</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-106"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#"><span class="hs-identifier">GHC.Prim</span></a></span><span class="hs-special">,</span><span>        </span><span class="hs-comment">-- Re-export GHC.Prim and [boot] GHC.Err,</span><span>
</span><span id="line-107"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.Ext.html#"><span class="hs-identifier">GHC.Prim.Ext</span></a></span><span class="hs-special">,</span><span>    </span><span class="hs-comment">-- to avoid lots of people having to</span><span>
</span><span id="line-108"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="GHC.Err.html"><span class="hs-identifier">GHC.Err</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- import it explicitly</span><span>
</span><span id="line-109"></span><span>        </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="GHC.Maybe.html"><span class="hs-identifier">GHC.Maybe</span></a></span><span>
</span><span id="line-110"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#"><span class="hs-identifier">GHC.Types</span></a></span><span>
</span><span id="line-114"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#"><span class="hs-identifier">GHC.Classes</span></a></span><span>
</span><span id="line-115"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#"><span class="hs-identifier">GHC.CString</span></a></span><span>
</span><span id="line-116"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Magic.html#"><span class="hs-identifier">GHC.Magic</span></a></span><span>
</span><span id="line-117"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#"><span class="hs-identifier">GHC.Prim</span></a></span><span>
</span><span id="line-118"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.Ext.html#"><span class="hs-identifier">GHC.Prim.Ext</span></a></span><span>
</span><span id="line-119"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Err.html"><span class="hs-identifier">GHC.Err</span></a></span><span>
</span><span id="line-120"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Maybe.html"><span class="hs-identifier">GHC.Maybe</span></a></span><span>
</span><span id="line-121"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.IO.html"><span class="hs-identifier">GHC.IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.html#mkUserError"><span class="hs-identifier">mkUserError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.html#mplusIO"><span class="hs-identifier">mplusIO</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#"><span class="hs-identifier">GHC.Tuple</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier">Solo</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- Note [Depend on GHC.Tuple]</span><span>
</span><span id="line-124"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#"><span class="hs-identifier">GHC.Num.Integer</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>        </span><span class="hs-comment">-- Note [Depend on GHC.Num.Integer]</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="hs-comment">-- for 'class Semigroup'</span><span>
</span><span id="line-127"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Real.html"><span class="hs-identifier">GHC.Real</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Real.html#Integral"><span class="hs-identifier">Integral</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="Data.Semigroup.Internal.html"><span class="hs-identifier">Data.Semigroup.Internal</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Data.Semigroup.Internal.html#stimesDefault"><span class="hs-identifier">stimesDefault</span></a></span><span>
</span><span id="line-129"></span><span>                                              </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Semigroup.Internal.html#stimesMaybe"><span class="hs-identifier">stimesMaybe</span></a></span><span>
</span><span id="line-130"></span><span>                                              </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Semigroup.Internal.html#stimesList"><span class="hs-identifier">stimesList</span></a></span><span>
</span><span id="line-131"></span><span>                                              </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Semigroup.Internal.html#stimesIdempotentMonoid"><span class="hs-identifier">stimesIdempotentMonoid</span></a></span><span>
</span><span id="line-132"></span><span>                                              </span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="hs-comment">-- $setup</span><span>
</span><span id="line-135"></span><span class="hs-comment">-- &gt;&gt;&gt; import GHC.Num</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">9</span><span>  </span><span class="annot"><a href="GHC.Base.html#."><span class="hs-operator hs-type">.</span></a></span><span>
</span><span id="line-138"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">5</span><span>  </span><span class="annot"><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-type">++</span></a></span><span>
</span><span id="line-139"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">4</span><span>  </span><span class="annot"><a href="GHC.Base.html#%3C%24"><span class="hs-operator hs-type">&lt;$</span></a></span><span>
</span><span id="line-140"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">1</span><span>  </span><span class="annot"><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-type">&gt;&gt;</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-type">&gt;&gt;=</span></a></span><span>
</span><span id="line-141"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">1</span><span>  </span><span class="annot"><a href="GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-type">=&lt;&lt;</span></a></span><span>
</span><span id="line-142"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">0</span><span>  </span><span class="annot"><a href="GHC.Base.html#%24"><span class="hs-operator hs-type">$</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#%24%21"><span class="hs-operator hs-type">$!</span></a></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">4</span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-type">&lt;*&gt;</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%2A"><span class="hs-operator hs-type">&lt;*</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-type">*&gt;</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%2A%2A%3E"><span class="hs-operator hs-type">&lt;**&gt;</span></a></span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-keyword">default</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>              </span><span class="hs-comment">-- Double isn't available yet</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-comment">{-
Note [Depend on GHC.Num.Integer]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Integer type is special because GHC.Iface.Tidy uses constructors in
GHC.Num.Integer to construct Integer literal values. Currently it reads the
interface file whether or not the current module *has* any Integer literals, so
it's important that GHC.Num.Integer is compiled before any other module.

(There's a hack in GHC to disable this for packages ghc-prim and ghc-bignum
which aren't allowed to contain any Integer literals.)

Likewise we implicitly need Integer when deriving things like Eq instances.

The danger is that if the build system doesn't know about the dependency
on Integer, it'll compile some base module before GHC.Num.Integer,
resulting in:
  Failed to load interface for &#8216;GHC.Num.Integer&#8217;
    There are files missing in the &#8216;ghc-bignum&#8217; package,

Bottom line: we make GHC.Base depend on GHC.Num.Integer; and everything
else either depends on GHC.Base, or does not have NoImplicitPrelude
(and hence depends on Prelude).

Note: this is only a problem with the make-based build system. Hadrian doesn't
seem to interleave compilation of modules from separate packages and respects
the dependency between `base` and `ghc-bignum`.

Note [Depend on GHC.Tuple]
~~~~~~~~~~~~~~~~~~~~~~~~~~
Similarly, tuple syntax (or ()) creates an implicit dependency on
GHC.Tuple, so we use the same rule as for Integer --- see Note [Depend on
GHC.Integer] --- to explain this to the build system.  We make GHC.Base
depend on GHC.Tuple, and everything else depends on GHC.Base or Prelude.

-}</span><span class="hs-cpp">

#if 0
</span><span class="hs-comment">-- for use when compiling GHC.Base itself doesn't work</span><span>
</span><span id="line-187"></span><span class="hs-keyword">data</span><span>  </span><span class="hs-identifier">Bool</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-identifier">False</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">True</span><span>
</span><span id="line-188"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">Ordering</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">LT</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">EQ</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">GT</span><span>
</span><span id="line-189"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">Char</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">C#</span><span> </span><span class="hs-identifier">Char#</span><span>
</span><span id="line-190"></span><span class="hs-keyword">type</span><span>  </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-identifier">Char</span><span class="hs-special">]</span><span>
</span><span id="line-191"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-identifier">Int#</span><span>
</span><span id="line-192"></span><span class="hs-keyword">data</span><span>  </span><span class="hs-special">(</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span class="hs-keyword">data</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">MkNil</span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="hs-identifier">not</span><span> </span><span class="hs-identifier">True</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">False</span><span>
</span><span id="line-196"></span><span class="hs-special">(</span><span class="hs-operator">&amp;&amp;</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">True</span><span> </span><span class="hs-identifier">True</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">True</span><span>
</span><span id="line-197"></span><span class="hs-identifier">otherwise</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">True</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="hs-identifier">build</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">errorWithoutStackTrace</span><span> </span><span class="hs-string">&quot;urk&quot;</span><span>
</span><span id="line-200"></span><span class="hs-identifier">foldr</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">errorWithoutStackTrace</span><span> </span><span class="hs-string">&quot;urk&quot;</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-203"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">6</span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-type">&lt;&gt;</span></a></span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span class="hs-comment">-- | The class of semigroups (types with an associative binary operation).</span><span>
</span><span id="line-206"></span><span class="hs-comment">--</span><span>
</span><span id="line-207"></span><span class="hs-comment">-- Instances should satisfy the following:</span><span>
</span><span id="line-208"></span><span class="hs-comment">--</span><span>
</span><span id="line-209"></span><span class="hs-comment">-- [Associativity] @x '&lt;&gt;' (y '&lt;&gt;' z) = (x '&lt;&gt;' y) '&lt;&gt;' z@</span><span>
</span><span id="line-210"></span><span class="hs-comment">--</span><span>
</span><span id="line-211"></span><span class="hs-comment">-- @since 4.9.0.0</span><span>
</span><span id="line-212"></span><span class="hs-keyword">class</span><span> </span><span id="Semigroup"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-var">Semigroup</span></a></span></span><span> </span><span id="local-6989586621679482835"><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-213"></span><span>        </span><span class="hs-comment">-- | An associative operation.</span><span>
</span><span id="line-214"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-215"></span><span>        </span><span class="hs-comment">-- &gt;&gt;&gt; [1,2,3] &lt;&gt; [4,5,6]</span><span>
</span><span id="line-216"></span><span>        </span><span class="hs-comment">-- [1,2,3,4,5,6]</span><span>
</span><span id="line-217"></span><span>        </span><span id="%3C%3E"><span class="annot"><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-type">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span>        </span><span class="hs-comment">-- | Reduce a non-empty list with '&lt;&gt;'</span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-221"></span><span>        </span><span class="hs-comment">-- The default definition should be sufficient, but this can be</span><span>
</span><span id="line-222"></span><span>        </span><span class="hs-comment">-- overridden for efficiency.</span><span>
</span><span id="line-223"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-224"></span><span>        </span><span class="hs-comment">-- &gt;&gt;&gt; import Data.List.NonEmpty (NonEmpty (..))</span><span>
</span><span id="line-225"></span><span>        </span><span class="hs-comment">-- &gt;&gt;&gt; sconcat $ &quot;Hello&quot; :| [&quot; &quot;, &quot;Haskell&quot;, &quot;!&quot;]</span><span>
</span><span id="line-226"></span><span>        </span><span class="hs-comment">-- &quot;Hello Haskell!&quot;</span><span>
</span><span id="line-227"></span><span>        </span><span id="sconcat"><span class="annot"><a href="GHC.Base.html#sconcat"><span class="hs-identifier hs-type">sconcat</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-228"></span><span>        </span><span id="local-6989586621679482178"><span class="annot"><a href="GHC.Base.html#sconcat"><span class="hs-identifier hs-var hs-var">sconcat</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679482176"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482176"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679482174"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482174"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; a
forall {t}. Semigroup t =&gt; t -&gt; [t] -&gt; t
</span><a href="#local-6989586621679482173"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482176"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482174"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-229"></span><span>          </span><span id="local-6989586621679482173"><span class="annot"><span class="annottext">go :: t -&gt; [t] -&gt; t
</span><a href="#local-6989586621679482173"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679482170"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679482170"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679482169"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679482169"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679482168"><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679482168"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679482170"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; t -&gt; t
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">t -&gt; [t] -&gt; t
</span><a href="#local-6989586621679482173"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679482169"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
</span><a href="#local-6989586621679482168"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-230"></span><span>          </span><span class="annot"><a href="#local-6989586621679482173"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679482167"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679482167"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679482167"><span class="hs-identifier hs-var">b</span></a></span></span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span>        </span><span class="hs-comment">-- | Repeat a value @n@ times.</span><span>
</span><span id="line-233"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-234"></span><span>        </span><span class="hs-comment">-- Given that this works on a 'Semigroup' it is allowed to fail if</span><span>
</span><span id="line-235"></span><span>        </span><span class="hs-comment">-- you request 0 or fewer repetitions, and the default definition</span><span>
</span><span id="line-236"></span><span>        </span><span class="hs-comment">-- will do so.</span><span>
</span><span id="line-237"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-238"></span><span>        </span><span class="hs-comment">-- By making this a member of the class, idempotent semigroups</span><span>
</span><span id="line-239"></span><span>        </span><span class="hs-comment">-- and monoids can upgrade this to execute in \(\mathcal{O}(1)\) by</span><span>
</span><span id="line-240"></span><span>        </span><span class="hs-comment">-- picking @stimes = 'Data.Semigroup.stimesIdempotent'@ or @stimes =</span><span>
</span><span id="line-241"></span><span>        </span><span class="hs-comment">-- 'stimesIdempotentMonoid'@ respectively.</span><span>
</span><span id="line-242"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-243"></span><span>        </span><span class="hs-comment">-- &gt;&gt;&gt; stimes 4 [1]</span><span>
</span><span id="line-244"></span><span>        </span><span class="hs-comment">-- [1,1,1,1]</span><span>
</span><span id="line-245"></span><span>        </span><span id="local-6989586621679482833"><span id="stimes"><span class="annot"><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-type">stimes</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Real.html#Integral"><span class="hs-identifier hs-type">Integral</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482833"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482833"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482835"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-246"></span><span>        </span><span id="local-6989586621679482165"><span class="annot"><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var hs-var">stimes</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
forall b a. (Integral b, Semigroup a) =&gt; b -&gt; a -&gt; a
</span><a href="Data.Semigroup.Internal.html#stimesDefault"><span class="hs-identifier hs-var">stimesDefault</span></a></span></span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- | The class of monoids (types with an associative binary operation that</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- has an identity).  Instances should satisfy the following:</span><span>
</span><span id="line-251"></span><span class="hs-comment">--</span><span>
</span><span id="line-252"></span><span class="hs-comment">-- [Right identity] @x '&lt;&gt;' 'mempty' = x@</span><span>
</span><span id="line-253"></span><span class="hs-comment">-- [Left identity]  @'mempty' '&lt;&gt;' x = x@</span><span>
</span><span id="line-254"></span><span class="hs-comment">-- [Associativity]  @x '&lt;&gt;' (y '&lt;&gt;' z) = (x '&lt;&gt;' y) '&lt;&gt;' z@ ('Semigroup' law)</span><span>
</span><span id="line-255"></span><span class="hs-comment">-- [Concatenation]  @'mconcat' = 'foldr' ('&lt;&gt;') 'mempty'@</span><span>
</span><span id="line-256"></span><span class="hs-comment">--</span><span>
</span><span id="line-257"></span><span class="hs-comment">-- The method names refer to the monoid of lists under concatenation,</span><span>
</span><span id="line-258"></span><span class="hs-comment">-- but there are many other instances.</span><span>
</span><span id="line-259"></span><span class="hs-comment">--</span><span>
</span><span id="line-260"></span><span class="hs-comment">-- Some types can be viewed as a monoid in more than one way,</span><span>
</span><span id="line-261"></span><span class="hs-comment">-- e.g. both addition and multiplication on numbers.</span><span>
</span><span id="line-262"></span><span class="hs-comment">-- In such cases we often define @newtype@s and make those instances</span><span>
</span><span id="line-263"></span><span class="hs-comment">-- of 'Monoid', e.g. 'Data.Semigroup.Sum' and 'Data.Semigroup.Product'.</span><span>
</span><span id="line-264"></span><span class="hs-comment">--</span><span>
</span><span id="line-265"></span><span class="hs-comment">-- __NOTE__: 'Semigroup' is a superclass of 'Monoid' since /base-4.11.0.0/.</span><span>
</span><span id="line-266"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Monoid"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-var">Monoid</span></a></span></span><span> </span><span id="local-6989586621679482829"><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-267"></span><span>        </span><span class="hs-comment">-- | Identity of 'mappend'</span><span>
</span><span id="line-268"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-269"></span><span>        </span><span class="hs-comment">-- &gt;&gt;&gt; &quot;Hello world&quot; &lt;&gt; mempty</span><span>
</span><span id="line-270"></span><span>        </span><span class="hs-comment">-- &quot;Hello world&quot;</span><span>
</span><span id="line-271"></span><span>        </span><span id="mempty"><span class="annot"><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-type">mempty</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span>        </span><span class="hs-comment">-- | An associative operation</span><span>
</span><span id="line-274"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-275"></span><span>        </span><span class="hs-comment">-- __NOTE__: This method is redundant and has the default</span><span>
</span><span id="line-276"></span><span>        </span><span class="hs-comment">-- implementation @'mappend' = ('&lt;&gt;')@ since /base-4.11.0.0/.</span><span>
</span><span id="line-277"></span><span>        </span><span class="hs-comment">-- Should it be implemented manually, since 'mappend' is a synonym for</span><span>
</span><span id="line-278"></span><span>        </span><span class="hs-comment">-- ('&lt;&gt;'), it is expected that the two functions are defined the same</span><span>
</span><span id="line-279"></span><span>        </span><span class="hs-comment">-- way. In a future GHC release 'mappend' will be removed from 'Monoid'.</span><span>
</span><span id="line-280"></span><span>        </span><span id="mappend"><span class="annot"><a href="GHC.Base.html#mappend"><span class="hs-identifier hs-type">mappend</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-281"></span><span>        </span><span id="local-6989586621679482160"><span class="annot"><a href="GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var">mappend</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(&lt;&gt;)</span></a></span></span><span>
</span><span id="line-282"></span><span>        </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#mappend"><span class="hs-pragma hs-type">mappend</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span>        </span><span class="hs-comment">-- | Fold a list using the monoid.</span><span>
</span><span id="line-285"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-286"></span><span>        </span><span class="hs-comment">-- For most types, the default definition for 'mconcat' will be</span><span>
</span><span id="line-287"></span><span>        </span><span class="hs-comment">-- used, but the function is included in the class definition so</span><span>
</span><span id="line-288"></span><span>        </span><span class="hs-comment">-- that an optimized version can be provided for specific types.</span><span>
</span><span id="line-289"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-290"></span><span>        </span><span class="hs-comment">-- &gt;&gt;&gt; mconcat [&quot;Hello&quot;, &quot; &quot;, &quot;Haskell&quot;, &quot;!&quot;]</span><span>
</span><span id="line-291"></span><span>        </span><span class="hs-comment">-- &quot;Hello Haskell!&quot;</span><span>
</span><span id="line-292"></span><span>        </span><span id="mconcat"><span class="annot"><a href="GHC.Base.html#mconcat"><span class="hs-identifier hs-type">mconcat</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482829"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-293"></span><span>        </span><span id="local-6989586621679482157"><span class="annot"><a href="GHC.Base.html#mconcat"><span class="hs-identifier hs-var hs-var">mconcat</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; a -&gt; [a] -&gt; a
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span></span><span>
</span><span id="line-294"></span><span>        </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#mconcat"><span class="hs-pragma hs-type">mconcat</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-295"></span><span>        </span><span class="hs-comment">-- INLINE in the hope of fusion with mconcat's argument (see !4890)</span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-298"></span><span id="local-6989586621679482826"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482152"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482826"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-299"></span><span>        </span><span id="local-6989586621679482149"><span class="annot"><span class="annottext">&lt;&gt; :: [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">(++)</span></a></span><span>
</span><span id="line-300"></span><span>        </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>        </span><span id="local-6989586621679482146"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679482146"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; [a] -&gt; [a]
forall b a. Integral b =&gt; b -&gt; [a] -&gt; [a]
</span><a href="Data.Semigroup.Internal.html#stimesList"><span class="hs-identifier hs-var">stimesList</span></a></span></span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-305"></span><span id="local-6989586621679482822"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482141"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482822"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-306"></span><span>        </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#mempty"><span class="hs-pragma hs-type">mempty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-307"></span><span>        </span><span id="local-6989586621679482138"><span class="annot"><span class="annottext">mempty :: [a]
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-308"></span><span>        </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#mconcat"><span class="hs-pragma hs-type">mconcat</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-309"></span><span>        </span><span id="local-6989586621679482137"><span class="annot"><span class="annottext">mconcat :: [[a]] -&gt; [a]
</span><a href="GHC.Base.html#mconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">mconcat</span></a></span></span><span> </span><span id="local-6989586621679482136"><span class="annot"><span class="annottext">[[a]]
</span><a href="#local-6989586621679482136"><span class="hs-identifier hs-var">xss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482135"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679482134"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482134"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[[a]]
</span><a href="#local-6989586621679482136"><span class="hs-identifier hs-var">xss</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679482135"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482135"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482134"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-310"></span><span class="hs-comment">-- See Note: [List comprehensions and inlining]</span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-comment">{-
Note: [List comprehensions and inlining]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The list monad operations are traditionally described in terms of concatMap:

xs &gt;&gt;= f = concatMap f xs

Similarly, mconcat for lists is just concat. Here in Base, however, we don't
have concatMap, and we'll refrain from adding it here so it won't have to be
hidden in imports. Instead, we use GHC's list comprehension desugaring
mechanism to define mconcat and the Applicative and Monad instances for lists.
We mark them INLINE because the inliner is not generally too keen to inline
build forms such as the ones these desugar to without our insistence.  Defining
these using list comprehensions instead of foldr has an additional potential
benefit, as described in compiler/GHC/HsToCore/ListComp.hs: if optimizations
needed to make foldr/build forms efficient are turned off, we'll get reasonably
efficient translations anyway.
-}</span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-332"></span><span id="local-6989586621679482821"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482129"><span id="local-6989586621679482131"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482821"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-333"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679482128"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482128"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679482127"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482127"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679482126"><span class="annot"><span class="annottext">&lt;&gt; :: NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679482125"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482125"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679482124"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482124"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482128"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482127"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482125"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679482124"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-336"></span><span id="local-6989586621679482817"><span id="local-6989586621679482818"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482121"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482818"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482817"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482818"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-337"></span><span>        </span><span id="local-6989586621679482118"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679482118"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679482117"><span class="annot"><span class="annottext">&lt;&gt; :: (a -&gt; b) -&gt; (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span id="local-6989586621679482116"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679482116"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679482115"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482115"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679482118"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482115"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679482116"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482115"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-338"></span><span>        </span><span id="local-6989586621679482111"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; (a -&gt; b) -&gt; a -&gt; b
</span><a href="#local-6989586621679482111"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span id="local-6989586621679482110"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482110"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679482109"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679482109"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679482108"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482108"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482110"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679482109"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482108"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-341"></span><span id="local-6989586621679482814"><span id="local-6989586621679482815"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482101"><span id="local-6989586621679482103"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482815"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482814"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482815"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-342"></span><span>        </span><span id="local-6989586621679482099"><span class="annot"><span class="annottext">mempty :: a -&gt; b
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span></span></span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-345"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-346"></span><span>        </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679482094"><span class="annot"><span class="annottext">&lt;&gt; :: () -&gt; () -&gt; ()
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>        </span><span id="local-6989586621679482093"><span class="annot"><span class="annottext">sconcat :: NonEmpty () -&gt; ()
</span><a href="#local-6989586621679482093"><span class="hs-identifier hs-var hs-var hs-var hs-var">sconcat</span></a></span></span><span> </span><span class="annot"><span class="annottext">NonEmpty ()
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span>        </span><span id="local-6989586621679482091"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; () -&gt; ()
</span><a href="#local-6989586621679482091"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span>  </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-349"></span><span>
</span><span id="line-350"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-351"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482086"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-352"></span><span>        </span><span class="hs-comment">-- Should it be strict?</span><span>
</span><span id="line-353"></span><span>        </span><span id="local-6989586621679482084"><span class="annot"><span class="annottext">mempty :: ()
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span>        </span><span id="local-6989586621679482083"><span class="annot"><span class="annottext">mconcat :: [()] -&gt; ()
</span><a href="GHC.Base.html#mconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">mconcat</span></a></span></span><span> </span><span class="annot"><span class="annottext">[()]
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span class="hs-comment">-- | @since 4.15</span><span>
</span><span id="line-357"></span><span id="local-6989586621679482812"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482080"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482812"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482812"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-358"></span><span>  </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679482077"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482077"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679482076"><span class="annot"><span class="annottext">&lt;&gt; :: Solo a -&gt; Solo a -&gt; Solo a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679482075"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482075"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Solo a
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482077"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482075"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span>  </span><span id="local-6989586621679482071"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; Solo a -&gt; Solo a
</span><a href="#local-6989586621679482071"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span id="local-6989586621679482070"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482070"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679482069"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482069"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Solo a
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482070"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482069"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-comment">-- | @since 4.15</span><span>
</span><span id="line-362"></span><span id="local-6989586621679482810"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482062"><span id="local-6989586621679482064"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482810"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482810"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-363"></span><span>  </span><span id="local-6989586621679482060"><span class="annot"><span class="annottext">mempty :: Solo a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Solo a
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span></span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-366"></span><span id="local-6989586621679482808"><span id="local-6989586621679482809"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482057"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482809"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482808"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482809"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482808"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-367"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679482053"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482053"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482052"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482052"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679482051"><span class="annot"><span class="annottext">&lt;&gt; :: (a, b) -&gt; (a, b) -&gt; (a, b)
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679482050"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482050"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482049"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482049"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482053"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482050"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482052"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482049"><span class="hs-identifier hs-var">b'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-368"></span><span>        </span><span id="local-6989586621679482043"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; (a, b) -&gt; (a, b)
</span><a href="#local-6989586621679482043"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span id="local-6989586621679482042"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482042"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679482041"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482041"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482040"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482040"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482042"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482041"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482042"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482040"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-371"></span><span id="local-6989586621679482805"><span id="local-6989586621679482806"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482033"><span id="local-6989586621679482035"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482806"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482805"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482806"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482805"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-372"></span><span>        </span><span id="local-6989586621679482030"><span class="annot"><span class="annottext">mempty :: (a, b)
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-375"></span><span id="local-6989586621679482802"><span id="local-6989586621679482803"><span id="local-6989586621679482804"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679482027"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482804"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482803"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482802"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482804"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482803"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482802"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-376"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679482022"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482022"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482021"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482021"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482020"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679482020"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679482019"><span class="annot"><span class="annottext">&lt;&gt; :: (a, b, c) -&gt; (a, b, c) -&gt; (a, b, c)
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679482018"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482018"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482017"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482017"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482016"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679482016"><span class="hs-identifier hs-var">c'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482022"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482018"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482021"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482017"><span class="hs-identifier hs-var">b'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679482020"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">c -&gt; c -&gt; c
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679482016"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-377"></span><span>        </span><span id="local-6989586621679482008"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; (a, b, c) -&gt; (a, b, c)
</span><a href="#local-6989586621679482008"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span id="local-6989586621679482007"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482007"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679482006"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482006"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482005"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482005"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679482004"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679482004"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482007"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679482006"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482007"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482005"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; c -&gt; c
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679482007"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679482004"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-380"></span><span id="local-6989586621679482798"><span id="local-6989586621679482799"><span id="local-6989586621679482800"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481997"><span id="local-6989586621679481999"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482800"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482799"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482798"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482800"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482799"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482798"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-381"></span><span>        </span><span id="local-6989586621679481993"><span class="annot"><span class="annottext">mempty :: (a, b, c)
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-384"></span><span id="local-6989586621679482794"><span id="local-6989586621679482795"><span id="local-6989586621679482796"><span id="local-6989586621679482797"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481990"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482797"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482796"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482795"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482794"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-385"></span><span>         </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482797"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482796"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482795"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482794"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-386"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679481984"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481984"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481983"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481983"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481982"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481982"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481981"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481981"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481980"><span class="annot"><span class="annottext">&lt;&gt; :: (a, b, c, d) -&gt; (a, b, c, d) -&gt; (a, b, c, d)
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481979"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481979"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481978"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481978"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481977"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481977"><span class="hs-identifier hs-var">c'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481976"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481976"><span class="hs-identifier hs-var">d'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481984"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481979"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481983"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481978"><span class="hs-identifier hs-var">b'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481982"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">c -&gt; c -&gt; c
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481977"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481981"><span class="hs-identifier hs-var">d</span></a></span><span class="annot"><span class="annottext">d -&gt; d -&gt; d
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481976"><span class="hs-identifier hs-var">d'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-387"></span><span>        </span><span id="local-6989586621679481966"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; (a, b, c, d) -&gt; (a, b, c, d)
</span><a href="#local-6989586621679481966"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span id="local-6989586621679481965"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481965"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481964"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481964"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481963"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481963"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481962"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481962"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481961"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481961"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481965"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481964"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481965"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481963"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; c -&gt; c
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481965"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481962"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; d -&gt; d
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481965"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481961"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-388"></span><span>
</span><span id="line-389"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-390"></span><span id="local-6989586621679482789"><span id="local-6989586621679482790"><span id="local-6989586621679482791"><span id="local-6989586621679482792"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481954"><span id="local-6989586621679481956"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482792"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482791"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482790"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482789"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482792"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482791"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482790"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482789"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-391"></span><span>        </span><span id="local-6989586621679481949"><span class="annot"><span class="annottext">mempty :: (a, b, c, d)
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">d
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-392"></span><span>
</span><span id="line-393"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-394"></span><span id="local-6989586621679482784"><span id="local-6989586621679482785"><span id="local-6989586621679482786"><span id="local-6989586621679482787"><span id="local-6989586621679482788"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481946"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482788"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482787"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482786"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482785"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482784"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>         </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482788"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482787"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482786"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482785"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482784"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-396"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679481939"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481939"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481938"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481938"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481937"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481937"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481936"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481936"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481935"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679481935"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481934"><span class="annot"><span class="annottext">&lt;&gt; :: (a, b, c, d, e) -&gt; (a, b, c, d, e) -&gt; (a, b, c, d, e)
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481933"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481933"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481932"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481932"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481931"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481931"><span class="hs-identifier hs-var">c'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481930"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481930"><span class="hs-identifier hs-var">d'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481929"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679481929"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481939"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481933"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481938"><span class="hs-identifier hs-var">b</span></a></span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481932"><span class="hs-identifier hs-var">b'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481937"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">c -&gt; c -&gt; c
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481931"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481936"><span class="hs-identifier hs-var">d</span></a></span><span class="annot"><span class="annottext">d -&gt; d -&gt; d
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481930"><span class="hs-identifier hs-var">d'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679481935"><span class="hs-identifier hs-var">e</span></a></span><span class="annot"><span class="annottext">e -&gt; e -&gt; e
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679481929"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>        </span><span id="local-6989586621679481917"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; (a, b, c, d, e) -&gt; (a, b, c, d, e)
</span><a href="#local-6989586621679481917"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span id="local-6989586621679481916"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481916"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481915"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481915"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481914"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481914"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481913"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481913"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481912"><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481912"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481911"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679481911"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-398"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; a -&gt; a
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481916"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481915"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481916"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481914"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; c -&gt; c
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481916"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481913"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; d -&gt; d
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481916"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">d
</span><a href="#local-6989586621679481912"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b -&gt; e -&gt; e
forall a b. (Semigroup a, Integral b) =&gt; b -&gt; a -&gt; a
</span><a href="GHC.Base.html#stimes"><span class="hs-identifier hs-var">stimes</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481916"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679481911"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-401"></span><span id="local-6989586621679482778"><span id="local-6989586621679482779"><span id="local-6989586621679482780"><span id="local-6989586621679482781"><span id="local-6989586621679482782"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481904"><span id="local-6989586621679481906"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482782"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482781"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482780"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482779"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482778"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-402"></span><span>                </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482782"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482781"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482780"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482779"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679482778"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-403"></span><span>        </span><span id="local-6989586621679481898"><span class="annot"><span class="annottext">mempty :: (a, b, c, d, e)
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">d
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">e
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span>
</span><span id="line-406"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-407"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481895"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier hs-type">Ordering</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-408"></span><span>    </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#LT"><span class="hs-identifier hs-var">LT</span></a></span><span> </span><span id="local-6989586621679481893"><span class="annot"><span class="annottext">&lt;&gt; :: Ordering -&gt; Ordering -&gt; Ordering
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#LT"><span class="hs-identifier hs-var">LT</span></a></span><span>
</span><span id="line-409"></span><span>    </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span id="local-6989586621679481892"><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679481892"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="#local-6989586621679481892"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-410"></span><span>    </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#GT"><span class="hs-identifier hs-var">GT</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#GT"><span class="hs-identifier hs-var">GT</span></a></span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span>    </span><span id="local-6989586621679481888"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; Ordering -&gt; Ordering
</span><a href="#local-6989586621679481888"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Ordering -&gt; Ordering
forall b a. (Integral b, Monoid a) =&gt; b -&gt; a -&gt; a
</span><a href="Data.Semigroup.Internal.html#stimesIdempotentMonoid"><span class="hs-identifier hs-var">stimesIdempotentMonoid</span></a></span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span class="hs-comment">-- lexicographical ordering</span><span>
</span><span id="line-415"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-416"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481881"><span id="local-6989586621679481883"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier hs-type">Ordering</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-417"></span><span>    </span><span id="local-6989586621679481880"><span class="annot"><span class="annottext">mempty :: Ordering
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-420"></span><span id="local-6989586621679482774"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481877"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482774"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482774"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-421"></span><span>    </span><span class="annot"><span class="annottext">Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621679481874"><span class="annot"><span class="annottext">&lt;&gt; :: Maybe a -&gt; Maybe a -&gt; Maybe a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span id="local-6989586621679481873"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481873"><span class="hs-identifier hs-var">b</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481873"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-422"></span><span>    </span><span id="local-6989586621679481872"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481872"><span class="hs-identifier hs-var">a</span></a></span></span><span>       </span><span class="annot"><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481872"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-423"></span><span>    </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481871"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481871"><span class="hs-identifier hs-var">a</span></a></span></span><span>  </span><span class="annot"><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481870"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481870"><span class="hs-identifier hs-var">b</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe a
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481871"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481870"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span>
</span><span id="line-425"></span><span>    </span><span id="local-6989586621679481866"><span class="annot"><span class="annottext">stimes :: forall b. Integral b =&gt; b -&gt; Maybe a -&gt; Maybe a
</span><a href="#local-6989586621679481866"><span class="hs-identifier hs-var hs-var hs-var hs-var">stimes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Maybe a -&gt; Maybe a
forall b a. (Integral b, Semigroup a) =&gt; b -&gt; Maybe a -&gt; Maybe a
</span><a href="Data.Semigroup.Internal.html#stimesMaybe"><span class="hs-identifier hs-var">stimesMaybe</span></a></span></span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span class="hs-comment">-- | Lift a semigroup into 'Maybe' forming a 'Monoid' according to</span><span>
</span><span id="line-428"></span><span class="hs-comment">-- &lt;http://en.wikipedia.org/wiki/Monoid&gt;: \&quot;Any semigroup @S@ may be</span><span>
</span><span id="line-429"></span><span class="hs-comment">-- turned into a monoid simply by adjoining an element @e@ not in @S@</span><span>
</span><span id="line-430"></span><span class="hs-comment">-- and defining @e*e = e@ and @e*s = s = s*e@ for all @s &#8712; S@.\&quot;</span><span>
</span><span id="line-431"></span><span class="hs-comment">--</span><span>
</span><span id="line-432"></span><span class="hs-comment">-- /Since 4.11.0/: constraint on inner @a@ value generalised from</span><span>
</span><span id="line-433"></span><span class="hs-comment">-- 'Monoid' to 'Semigroup'.</span><span>
</span><span id="line-434"></span><span class="hs-comment">--</span><span>
</span><span id="line-435"></span><span class="hs-comment">-- @since 2.01</span><span>
</span><span id="line-436"></span><span id="local-6989586621679482770"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481859"><span id="local-6989586621679481861"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482770"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482770"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-437"></span><span>    </span><span id="local-6989586621679481858"><span class="annot"><span class="annottext">mempty :: Maybe a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span></span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="hs-comment">-- | @since 4.15</span><span>
</span><span id="line-440"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481848"><span id="local-6989586621679481850"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-441"></span><span>  </span><span id="local-6989586621679481846"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; Solo a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Solo a
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span>  </span><span class="hs-comment">-- Note: we really want to match strictly here. This lets us write,</span><span>
</span><span id="line-444"></span><span>  </span><span class="hs-comment">-- for example,</span><span>
</span><span id="line-445"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-446"></span><span>  </span><span class="hs-comment">-- forceSpine :: Foldable f =&gt; f a -&gt; ()</span><span>
</span><span id="line-447"></span><span>  </span><span class="hs-comment">-- forceSpine xs</span><span>
</span><span id="line-448"></span><span>  </span><span class="hs-comment">--   | Solo r &lt;- traverse_ Solo xs</span><span>
</span><span id="line-449"></span><span>  </span><span class="hs-comment">--   = r</span><span>
</span><span id="line-450"></span><span>  </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679481845"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481845"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481844"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. Solo (a -&gt; b) -&gt; Solo a -&gt; Solo b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679481843"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481843"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Solo b
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481845"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481843"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-451"></span><span>  </span><span id="local-6989586621679481842"><span class="annot"><span class="annottext">liftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; Solo a -&gt; Solo b -&gt; Solo c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span id="local-6989586621679481840"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481840"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679481839"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481839"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679481838"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481838"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">c -&gt; Solo c
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481840"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481839"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481838"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="hs-comment">-- | For tuples, the 'Monoid' constraint on @a@ determines</span><span>
</span><span id="line-454"></span><span class="hs-comment">-- how the first values merge.</span><span>
</span><span id="line-455"></span><span class="hs-comment">-- For example, 'String's concatenate:</span><span>
</span><span id="line-456"></span><span class="hs-comment">--</span><span>
</span><span id="line-457"></span><span class="hs-comment">-- &gt; (&quot;hello &quot;, (+15)) &lt;*&gt; (&quot;world!&quot;, 2002)</span><span>
</span><span id="line-458"></span><span class="hs-comment">-- &gt; (&quot;hello world!&quot;,2017)</span><span>
</span><span id="line-459"></span><span class="hs-comment">--</span><span>
</span><span id="line-460"></span><span class="hs-comment">-- @since 2.01</span><span>
</span><span id="line-461"></span><span id="local-6989586621679482752"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481829"><span id="local-6989586621679481831"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482752"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482752"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-462"></span><span>    </span><span id="local-6989586621679481827"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; (a, a)
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679481826"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481826"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481826"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-463"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679481824"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481824"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481823"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481823"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481822"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. (a, a -&gt; b) -&gt; (a, a) -&gt; (a, b)
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481821"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481821"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481820"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481820"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481824"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481821"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481823"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481820"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-464"></span><span>    </span><span id="local-6989586621679481818"><span class="annot"><span class="annottext">liftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; (a, a) -&gt; (a, b) -&gt; (a, c)
</span><a href="#local-6989586621679481818"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span id="local-6989586621679481817"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481817"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481816"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481816"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481815"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481815"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481814"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481814"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481813"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481813"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481816"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481814"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481817"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481815"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481813"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span class="hs-comment">-- | @since 4.15</span><span>
</span><span id="line-467"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481806"><span id="local-6989586621679481808"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-468"></span><span>  </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679481804"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481804"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679481803"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. Solo a -&gt; (a -&gt; Solo b) -&gt; Solo b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481802"><span class="annot"><span class="annottext">a -&gt; Solo b
</span><a href="#local-6989586621679481802"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Solo b
</span><a href="#local-6989586621679481802"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481804"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-471"></span><span id="local-6989586621679482736"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481795"><span id="local-6989586621679481797"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482736"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482736"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-472"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679481793"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481793"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481792"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481792"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481791"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. (a, a) -&gt; (a -&gt; (a, b)) -&gt; (a, b)
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481790"><span class="annot"><span class="annottext">a -&gt; (a, b)
</span><a href="#local-6989586621679481790"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; (a, b)
</span><a href="#local-6989586621679481790"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481792"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481789"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481789"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481788"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481788"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481793"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481789"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481788"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-475"></span><span id="local-6989586621679482727"><span id="local-6989586621679482728"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481785"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482728"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482727"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-476"></span><span>    </span><span id="local-6989586621679481783"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; (a, b, a) -&gt; (a, b, b)
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679481782"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481782"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481781"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481781"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481780"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481780"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481779"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481779"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481781"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481780"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481782"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481779"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-477"></span><span>
</span><span id="line-478"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-479"></span><span id="local-6989586621679482723"><span id="local-6989586621679482724"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481769"><span id="local-6989586621679481771"><span id="local-6989586621679481773"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482724"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482723"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482724"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482723"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-480"></span><span>    </span><span id="local-6989586621679481766"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; (a, b, a)
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679481765"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481765"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481765"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-481"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679481762"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481762"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481761"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481761"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481760"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481760"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481759"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. (a, b, a -&gt; b) -&gt; (a, b, a) -&gt; (a, b, b)
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481758"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481758"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481757"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481757"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481756"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481756"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481762"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481758"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481761"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481757"><span class="hs-identifier hs-var">b'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481760"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481756"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-482"></span><span>
</span><span id="line-483"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-484"></span><span id="local-6989586621679482718"><span id="local-6989586621679482719"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481749"><span id="local-6989586621679481751"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482719"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482718"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482719"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482718"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-485"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679481746"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481746"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481745"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481745"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481744"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481744"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481743"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. (a, b, a) -&gt; (a -&gt; (a, b, b)) -&gt; (a, b, b)
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481742"><span class="annot"><span class="annottext">a -&gt; (a, b, b)
</span><a href="#local-6989586621679481742"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; (a, b, b)
</span><a href="#local-6989586621679481742"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481744"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481741"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481741"><span class="hs-identifier hs-var">u'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481740"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481740"><span class="hs-identifier hs-var">v'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481739"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481739"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481746"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481741"><span class="hs-identifier hs-var">u'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481745"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481740"><span class="hs-identifier hs-var">v'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481739"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-486"></span><span>
</span><span id="line-487"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-488"></span><span id="local-6989586621679482713"><span id="local-6989586621679482714"><span id="local-6989586621679482715"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481736"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482715"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482714"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482713"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-489"></span><span>    </span><span id="local-6989586621679481735"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; (a, b, c, a) -&gt; (a, b, c, b)
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679481734"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481734"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481733"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481733"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481732"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481732"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481731"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481731"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481730"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481730"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481733"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481732"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481731"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481734"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481730"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-492"></span><span id="local-6989586621679482708"><span id="local-6989586621679482709"><span id="local-6989586621679482710"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481720"><span id="local-6989586621679481722"><span id="local-6989586621679481724"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482710"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482709"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482708"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482710"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482709"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482708"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-493"></span><span>    </span><span id="local-6989586621679481716"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; (a, b, c, a)
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679481715"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481715"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481715"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-494"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679481711"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481711"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481710"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481710"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481709"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481709"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481708"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481708"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481707"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. (a, b, c, a -&gt; b) -&gt; (a, b, c, a) -&gt; (a, b, c, b)
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481706"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481706"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481705"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481705"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481704"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481704"><span class="hs-identifier hs-var">c'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481703"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481703"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481711"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481706"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481710"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481705"><span class="hs-identifier hs-var">b'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481709"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; c -&gt; c
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481704"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481708"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481703"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-495"></span><span>
</span><span id="line-496"></span><span class="hs-comment">-- | @since 4.14.0.0</span><span>
</span><span id="line-497"></span><span id="local-6989586621679482702"><span id="local-6989586621679482703"><span id="local-6989586621679482704"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481696"><span id="local-6989586621679481698"><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482704"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482703"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482702"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482704"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482703"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482702"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-498"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679481692"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481692"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481691"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481691"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481690"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481690"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481689"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481689"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481688"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. (a, b, c, a) -&gt; (a -&gt; (a, b, c, b)) -&gt; (a, b, c, b)
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481687"><span class="annot"><span class="annottext">a -&gt; (a, b, c, b)
</span><a href="#local-6989586621679481687"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; (a, b, c, b)
</span><a href="#local-6989586621679481687"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481689"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481686"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481686"><span class="hs-identifier hs-var">u'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481685"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481685"><span class="hs-identifier hs-var">v'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481684"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481684"><span class="hs-identifier hs-var">w'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481683"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481683"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481692"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481686"><span class="hs-identifier hs-var">u'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481691"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; b
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481685"><span class="hs-identifier hs-var">v'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481690"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; c -&gt; c
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679481684"><span class="hs-identifier hs-var">w'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481683"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span class="hs-comment">-- | @since 4.10.0.0</span><span>
</span><span id="line-501"></span><span id="local-6989586621679482699"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481678"><span id="local-6989586621679481680"><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482699"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482699"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-502"></span><span>    </span><span id="local-6989586621679481675"><span class="annot"><span class="annottext">&lt;&gt; :: IO a -&gt; IO a -&gt; IO a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; IO a -&gt; IO a -&gt; IO a
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(&lt;&gt;)</span></a></span></span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-505"></span><span id="local-6989586621679482698"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481668"><span id="local-6989586621679481670"><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482698"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482698"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-506"></span><span>    </span><span id="local-6989586621679481665"><span class="annot"><span class="annottext">mempty :: IO a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span></span><span>
</span><span id="line-507"></span><span>
</span><span id="line-508"></span><span class="hs-comment">{- | A type @f@ is a Functor if it provides a function @fmap@ which, given any types @a@ and @b@
lets you apply any function from @(a -&gt; b)@ to turn an @f a@ into an @f b@, preserving the
structure of @f@. Furthermore @f@ needs to adhere to the following:

[Identity]    @'fmap' 'id' == 'id'@
[Composition] @'fmap' (f . g) == 'fmap' f . 'fmap' g@

Note, that the second law follows from the free theorem of the type 'fmap' and
the first law, so you need only check that the former condition holds.
-}</span><span>
</span><span id="line-518"></span><span>
</span><span id="line-519"></span><span class="hs-keyword">class</span><span> </span><span id="Functor"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-var">Functor</span></a></span></span><span> </span><span id="local-6989586621679482729"><span class="annot"><a href="#local-6989586621679482729"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-520"></span><span>    </span><span class="hs-comment">-- | 'fmap' is used to apply a function of type @(a -&gt; b)@ to a value of type @f a@,</span><span>
</span><span id="line-521"></span><span>    </span><span class="hs-comment">-- where f is a functor, to produce a value of type @f b@.</span><span>
</span><span id="line-522"></span><span>    </span><span class="hs-comment">-- Note that for any type constructor with more than one parameter (e.g., `Either`),</span><span>
</span><span id="line-523"></span><span>    </span><span class="hs-comment">-- only the last type parameter can be modified with `fmap` (e.g., `b` in `Either a b`).</span><span>
</span><span id="line-524"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-525"></span><span>    </span><span class="hs-comment">-- Some type constructors with two parameters or more have a @'Data.Bifunctor'@ instance that allows</span><span>
</span><span id="line-526"></span><span>    </span><span class="hs-comment">-- both the last and the penultimate parameters to be mapped over.</span><span>
</span><span id="line-527"></span><span>    </span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-528"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-529"></span><span>    </span><span class="hs-comment">-- Convert from a @'Data.Maybe.Maybe' Int@ to a @Maybe String@</span><span>
</span><span id="line-530"></span><span>    </span><span class="hs-comment">-- using 'Prelude.show':</span><span>
</span><span id="line-531"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-532"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; fmap show Nothing</span><span>
</span><span id="line-533"></span><span>    </span><span class="hs-comment">-- Nothing</span><span>
</span><span id="line-534"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; fmap show (Just 3)</span><span>
</span><span id="line-535"></span><span>    </span><span class="hs-comment">-- Just &quot;3&quot;</span><span>
</span><span id="line-536"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-537"></span><span>    </span><span class="hs-comment">-- Convert from an @'Data.Either.Either' Int Int@ to an</span><span>
</span><span id="line-538"></span><span>    </span><span class="hs-comment">-- @Either Int String@ using 'Prelude.show':</span><span>
</span><span id="line-539"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-540"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; fmap show (Left 17)</span><span>
</span><span id="line-541"></span><span>    </span><span class="hs-comment">-- Left 17</span><span>
</span><span id="line-542"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; fmap show (Right 17)</span><span>
</span><span id="line-543"></span><span>    </span><span class="hs-comment">-- Right &quot;17&quot;</span><span>
</span><span id="line-544"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-545"></span><span>    </span><span class="hs-comment">-- Double each element of a list:</span><span>
</span><span id="line-546"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-547"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; fmap (*2) [1,2,3]</span><span>
</span><span id="line-548"></span><span>    </span><span class="hs-comment">-- [2,4,6]</span><span>
</span><span id="line-549"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-550"></span><span>    </span><span class="hs-comment">-- Apply 'Prelude.even' to the second element of a pair:</span><span>
</span><span id="line-551"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-552"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; fmap even (2,2)</span><span>
</span><span id="line-553"></span><span>    </span><span class="hs-comment">-- (2,True)</span><span>
</span><span id="line-554"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-555"></span><span>    </span><span class="hs-comment">-- It may seem surprising that the function is only applied to the last element of the tuple</span><span>
</span><span id="line-556"></span><span>    </span><span class="hs-comment">-- compared to the list example above which applies it to every element in the list.</span><span>
</span><span id="line-557"></span><span>    </span><span class="hs-comment">-- To understand, remember that tuples are type constructors with multiple type parameters:</span><span>
</span><span id="line-558"></span><span>    </span><span class="hs-comment">-- a tuple of 3 elements `(a,b,c)` can also be written `(,,) a b c` and its `Functor` instance</span><span>
</span><span id="line-559"></span><span>    </span><span class="hs-comment">-- is defined for `Functor ((,,) a b)` (i.e., only the third parameter is free to be mapped over</span><span>
</span><span id="line-560"></span><span>    </span><span class="hs-comment">-- with `fmap`).</span><span>
</span><span id="line-561"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-562"></span><span>    </span><span class="hs-comment">-- It explains why `fmap` can be used with tuples containing values of different types as in the</span><span>
</span><span id="line-563"></span><span>    </span><span class="hs-comment">-- following example:</span><span>
</span><span id="line-564"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-565"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; fmap even (&quot;hello&quot;, 1.0, 4)</span><span>
</span><span id="line-566"></span><span>    </span><span class="hs-comment">-- (&quot;hello&quot;,1.0,True)</span><span>
</span><span id="line-567"></span><span>
</span><span id="line-568"></span><span>    </span><span id="local-6989586621679482732"><span id="local-6989586621679482733"><span id="fmap"><span class="annot"><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-type">fmap</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482733"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482732"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482729"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482733"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482729"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482732"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-569"></span><span>
</span><span id="line-570"></span><span>    </span><span class="hs-comment">-- | Replace all locations in the input with the same value.</span><span>
</span><span id="line-571"></span><span>    </span><span class="hs-comment">-- The default definition is @'fmap' . 'const'@, but this may be</span><span>
</span><span id="line-572"></span><span>    </span><span class="hs-comment">-- overridden with a more efficient version.</span><span>
</span><span id="line-573"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-574"></span><span>    </span><span id="local-6989586621679482730"><span id="local-6989586621679482731"><span id="%3C%24"><span class="annot"><a href="GHC.Base.html#%3C%24"><span class="hs-operator hs-type">(&lt;$)</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482731"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482729"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482730"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482729"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482731"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-575"></span><span>    </span><span id="local-6989586621679481663"><span class="annot"><a href="GHC.Base.html#%3C%24"><span class="hs-operator hs-var hs-var">(&lt;$)</span></a></span><span>        </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">(b -&gt; a) -&gt; f b -&gt; f a
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">((b -&gt; a) -&gt; f b -&gt; f a) -&gt; (a -&gt; b -&gt; a) -&gt; a -&gt; f b -&gt; f a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span></span><span>
</span><span id="line-576"></span><span>
</span><span id="line-577"></span><span class="hs-comment">-- | A functor with application, providing operations to</span><span>
</span><span id="line-578"></span><span class="hs-comment">--</span><span>
</span><span id="line-579"></span><span class="hs-comment">-- * embed pure expressions ('pure'), and</span><span>
</span><span id="line-580"></span><span class="hs-comment">--</span><span>
</span><span id="line-581"></span><span class="hs-comment">-- * sequence computations and combine their results ('&lt;*&gt;' and 'liftA2').</span><span>
</span><span id="line-582"></span><span class="hs-comment">--</span><span>
</span><span id="line-583"></span><span class="hs-comment">-- A minimal complete definition must include implementations of 'pure'</span><span>
</span><span id="line-584"></span><span class="hs-comment">-- and of either '&lt;*&gt;' or 'liftA2'. If it defines both, then they must behave</span><span>
</span><span id="line-585"></span><span class="hs-comment">-- the same as their default definitions:</span><span>
</span><span id="line-586"></span><span class="hs-comment">--</span><span>
</span><span id="line-587"></span><span class="hs-comment">--      @('&lt;*&gt;') = 'liftA2' 'id'@</span><span>
</span><span id="line-588"></span><span class="hs-comment">--</span><span>
</span><span id="line-589"></span><span class="hs-comment">--      @'liftA2' f x y = f 'Prelude.&lt;$&gt;' x '&lt;*&gt;' y@</span><span>
</span><span id="line-590"></span><span class="hs-comment">--</span><span>
</span><span id="line-591"></span><span class="hs-comment">-- Further, any definition must satisfy the following:</span><span>
</span><span id="line-592"></span><span class="hs-comment">--</span><span>
</span><span id="line-593"></span><span class="hs-comment">-- [Identity]</span><span>
</span><span id="line-594"></span><span class="hs-comment">--</span><span>
</span><span id="line-595"></span><span class="hs-comment">--      @'pure' 'id' '&lt;*&gt;' v = v@</span><span>
</span><span id="line-596"></span><span class="hs-comment">--</span><span>
</span><span id="line-597"></span><span class="hs-comment">-- [Composition]</span><span>
</span><span id="line-598"></span><span class="hs-comment">--</span><span>
</span><span id="line-599"></span><span class="hs-comment">--      @'pure' (.) '&lt;*&gt;' u '&lt;*&gt;' v '&lt;*&gt;' w = u '&lt;*&gt;' (v '&lt;*&gt;' w)@</span><span>
</span><span id="line-600"></span><span class="hs-comment">--</span><span>
</span><span id="line-601"></span><span class="hs-comment">-- [Homomorphism]</span><span>
</span><span id="line-602"></span><span class="hs-comment">--</span><span>
</span><span id="line-603"></span><span class="hs-comment">--      @'pure' f '&lt;*&gt;' 'pure' x = 'pure' (f x)@</span><span>
</span><span id="line-604"></span><span class="hs-comment">--</span><span>
</span><span id="line-605"></span><span class="hs-comment">-- [Interchange]</span><span>
</span><span id="line-606"></span><span class="hs-comment">--</span><span>
</span><span id="line-607"></span><span class="hs-comment">--      @u '&lt;*&gt;' 'pure' y = 'pure' ('$' y) '&lt;*&gt;' u@</span><span>
</span><span id="line-608"></span><span class="hs-comment">--</span><span>
</span><span id="line-609"></span><span class="hs-comment">--</span><span>
</span><span id="line-610"></span><span class="hs-comment">-- The other methods have the following default definitions, which may</span><span>
</span><span id="line-611"></span><span class="hs-comment">-- be overridden with equivalent specialized implementations:</span><span>
</span><span id="line-612"></span><span class="hs-comment">--</span><span>
</span><span id="line-613"></span><span class="hs-comment">--   * @u '*&gt;' v = ('id' '&lt;$' u) '&lt;*&gt;' v@</span><span>
</span><span id="line-614"></span><span class="hs-comment">--</span><span>
</span><span id="line-615"></span><span class="hs-comment">--   * @u '&lt;*' v = 'liftA2' 'const' u v@</span><span>
</span><span id="line-616"></span><span class="hs-comment">--</span><span>
</span><span id="line-617"></span><span class="hs-comment">-- As a consequence of these laws, the 'Functor' instance for @f@ will satisfy</span><span>
</span><span id="line-618"></span><span class="hs-comment">--</span><span>
</span><span id="line-619"></span><span class="hs-comment">--   * @'fmap' f x = 'pure' f '&lt;*&gt;' x@</span><span>
</span><span id="line-620"></span><span class="hs-comment">--</span><span>
</span><span id="line-621"></span><span class="hs-comment">--</span><span>
</span><span id="line-622"></span><span class="hs-comment">-- It may be useful to note that supposing</span><span>
</span><span id="line-623"></span><span class="hs-comment">--</span><span>
</span><span id="line-624"></span><span class="hs-comment">--      @forall x y. p (q x y) = f x . g y@</span><span>
</span><span id="line-625"></span><span class="hs-comment">--</span><span>
</span><span id="line-626"></span><span class="hs-comment">-- it follows from the above that</span><span>
</span><span id="line-627"></span><span class="hs-comment">--</span><span>
</span><span id="line-628"></span><span class="hs-comment">--      @'liftA2' p ('liftA2' q u v) = 'liftA2' f u . 'liftA2' g v@</span><span>
</span><span id="line-629"></span><span class="hs-comment">--</span><span>
</span><span id="line-630"></span><span class="hs-comment">--</span><span>
</span><span id="line-631"></span><span class="hs-comment">-- If @f@ is also a 'Monad', it should satisfy</span><span>
</span><span id="line-632"></span><span class="hs-comment">--</span><span>
</span><span id="line-633"></span><span class="hs-comment">--   * @'pure' = 'return'@</span><span>
</span><span id="line-634"></span><span class="hs-comment">--</span><span>
</span><span id="line-635"></span><span class="hs-comment">--   * @m1 '&lt;*&gt;' m2 = m1 '&gt;&gt;=' (\x1 -&gt; m2 '&gt;&gt;=' (\x2 -&gt; 'return' (x1 x2)))@</span><span>
</span><span id="line-636"></span><span class="hs-comment">--</span><span>
</span><span id="line-637"></span><span class="hs-comment">--   * @('*&gt;') = ('&gt;&gt;')@</span><span>
</span><span id="line-638"></span><span class="hs-comment">--</span><span>
</span><span id="line-639"></span><span class="hs-comment">-- (which implies that 'pure' and '&lt;*&gt;' satisfy the applicative functor laws).</span><span>
</span><span id="line-640"></span><span>
</span><span id="line-641"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Applicative"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-var">Applicative</span></a></span></span><span> </span><span id="local-6989586621679482760"><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-642"></span><span>    </span><span class="hs-pragma">{-# MINIMAL</span><span> </span><span class="annot"><a href="GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span class="hs-pragma">,</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">|</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA2"><span class="hs-pragma hs-type">liftA2</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-643"></span><span>    </span><span class="hs-comment">-- | Lift a value.</span><span>
</span><span id="line-644"></span><span>    </span><span id="local-6989586621679482759"><span id="pure"><span class="annot"><a href="GHC.Base.html#pure"><span class="hs-identifier hs-type">pure</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482759"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482759"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span>    </span><span class="hs-comment">-- | Sequential application.</span><span>
</span><span id="line-647"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-648"></span><span>    </span><span class="hs-comment">-- A few functors support an implementation of '&lt;*&gt;' that is more</span><span>
</span><span id="line-649"></span><span>    </span><span class="hs-comment">-- efficient than the default one.</span><span>
</span><span id="line-650"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-651"></span><span>    </span><span class="hs-comment">-- ==== __Example__</span><span>
</span><span id="line-652"></span><span>    </span><span class="hs-comment">-- Used in combination with @('&lt;$&gt;')@, @('&lt;*&gt;')@ can be used to build a record.</span><span>
</span><span id="line-653"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-654"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}</span><span>
</span><span id="line-655"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-656"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; produceFoo :: Applicative f =&gt; f Foo</span><span>
</span><span id="line-657"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-658"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; produceBar :: Applicative f =&gt; f Bar</span><span>
</span><span id="line-659"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; produceBaz :: Applicative f =&gt; f Baz</span><span>
</span><span id="line-660"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-661"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; mkState :: Applicative f =&gt; f MyState</span><span>
</span><span id="line-662"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; mkState = MyState &lt;$&gt; produceFoo &lt;*&gt; produceBar &lt;*&gt; produceBaz</span><span>
</span><span id="line-663"></span><span>    </span><span id="local-6989586621679482768"><span id="local-6989586621679482769"><span id="%3C%2A%3E"><span class="annot"><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-type">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482769"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482768"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482769"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482768"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-664"></span><span>    </span><span id="local-6989586621679481658"><span class="annot"><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var">(&lt;*&gt;)</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((a -&gt; b) -&gt; a -&gt; b) -&gt; f (a -&gt; b) -&gt; f a -&gt; f b
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; a -&gt; b
forall a. a -&gt; a
</span><a href="GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-665"></span><span>
</span><span id="line-666"></span><span>    </span><span class="hs-comment">-- | Lift a binary function to actions.</span><span>
</span><span id="line-667"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-668"></span><span>    </span><span class="hs-comment">-- Some functors support an implementation of 'liftA2' that is more</span><span>
</span><span id="line-669"></span><span>    </span><span class="hs-comment">-- efficient than the default one. In particular, if 'fmap' is an</span><span>
</span><span id="line-670"></span><span>    </span><span class="hs-comment">-- expensive operation, it is likely better to use 'liftA2' than to</span><span>
</span><span id="line-671"></span><span>    </span><span class="hs-comment">-- 'fmap' over the structure and then use '&lt;*&gt;'.</span><span>
</span><span id="line-672"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-673"></span><span>    </span><span class="hs-comment">-- This became a typeclass method in 4.10.0.0. Prior to that, it was</span><span>
</span><span id="line-674"></span><span>    </span><span class="hs-comment">-- a function defined in terms of '&lt;*&gt;' and 'fmap'.</span><span>
</span><span id="line-675"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-676"></span><span>    </span><span class="hs-comment">-- ==== __Example__</span><span>
</span><span id="line-677"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; liftA2 (,) (Just 3) (Just 5)</span><span>
</span><span id="line-678"></span><span>    </span><span class="hs-comment">-- Just (3,5)</span><span>
</span><span id="line-679"></span><span>
</span><span id="line-680"></span><span>    </span><span id="local-6989586621679482765"><span id="local-6989586621679482766"><span id="local-6989586621679482767"><span id="liftA2"><span class="annot"><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-type">liftA2</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482767"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482766"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482765"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482767"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482766"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482765"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-681"></span><span>    </span><span id="local-6989586621679481655"><span class="annot"><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var hs-var">liftA2</span></a></span><span> </span><span id="local-6989586621679481651"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481651"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481650"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481650"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f (b -&gt; c) -&gt; f b -&gt; f c
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">(&lt;*&gt;)</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b -&gt; c) -&gt; f a -&gt; f (b -&gt; c)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481651"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481650"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-682"></span><span>
</span><span id="line-683"></span><span>    </span><span class="hs-comment">-- | Sequence actions, discarding the value of the first argument.</span><span>
</span><span id="line-684"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-685"></span><span>    </span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-686"></span><span>    </span><span class="hs-comment">-- If used in conjunction with the Applicative instance for 'Maybe',</span><span>
</span><span id="line-687"></span><span>    </span><span class="hs-comment">-- you can chain Maybe computations, with a possible &quot;early return&quot;</span><span>
</span><span id="line-688"></span><span>    </span><span class="hs-comment">-- in case of 'Nothing'.</span><span>
</span><span id="line-689"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-690"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; Just 2 *&gt; Just 3</span><span>
</span><span id="line-691"></span><span>    </span><span class="hs-comment">-- Just 3</span><span>
</span><span id="line-692"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-693"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; Nothing *&gt; Just 3</span><span>
</span><span id="line-694"></span><span>    </span><span class="hs-comment">-- Nothing</span><span>
</span><span id="line-695"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-696"></span><span>    </span><span class="hs-comment">-- Of course a more interesting use case would be to have effectful</span><span>
</span><span id="line-697"></span><span>    </span><span class="hs-comment">-- computations instead of just returning pure values.</span><span>
</span><span id="line-698"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-699"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; import Data.Char</span><span>
</span><span id="line-700"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; import Text.ParserCombinators.ReadP</span><span>
</span><span id="line-701"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; let p = string &quot;my name is &quot; *&gt; munch1 isAlpha &lt;* eof</span><span>
</span><span id="line-702"></span><span>    </span><span class="hs-comment">-- &gt;&gt;&gt; readP_to_S p &quot;my name is Simon&quot;</span><span>
</span><span id="line-703"></span><span>    </span><span class="hs-comment">-- [(&quot;Simon&quot;,&quot;&quot;)]</span><span>
</span><span id="line-704"></span><span>
</span><span id="line-705"></span><span>    </span><span id="local-6989586621679482763"><span id="local-6989586621679482764"><span id="%2A%3E"><span class="annot"><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-type">(*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482764"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482763"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482763"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-706"></span><span>    </span><span id="local-6989586621679481649"><span id="local-6989586621679481645"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481645"><span class="hs-identifier hs-var">a1</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var hs-var">*&gt;</span></a></span><span> </span><span id="local-6989586621679481644"><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679481644"><span class="hs-identifier hs-var">a2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; b
forall a. a -&gt; a
</span><a href="GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; b) -&gt; f a -&gt; f (b -&gt; b)
forall (f :: * -&gt; *) a b. Functor f =&gt; a -&gt; f b -&gt; f a
</span><a href="GHC.Base.html#%3C%24"><span class="hs-operator hs-var">&lt;$</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481645"><span class="hs-identifier hs-var">a1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f (b -&gt; b) -&gt; f b -&gt; f b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679481644"><span class="hs-identifier hs-var">a2</span></a></span></span><span>
</span><span id="line-707"></span><span>
</span><span id="line-708"></span><span>    </span><span class="hs-comment">-- This is essentially the same as liftA2 (flip const), but if the</span><span>
</span><span id="line-709"></span><span>    </span><span class="hs-comment">-- Functor instance has an optimized (&lt;$), it may be better to use</span><span>
</span><span id="line-710"></span><span>    </span><span class="hs-comment">-- that instead. Before liftA2 became a method, this definition</span><span>
</span><span id="line-711"></span><span>    </span><span class="hs-comment">-- was strictly better, but now it depends on the functor. For a</span><span>
</span><span id="line-712"></span><span>    </span><span class="hs-comment">-- functor supporting a sharing-enhancing (&lt;$), this definition</span><span>
</span><span id="line-713"></span><span>    </span><span class="hs-comment">-- may reduce allocation by preventing a1 from ever being fully</span><span>
</span><span id="line-714"></span><span>    </span><span class="hs-comment">-- realized. In an implementation with a boring (&lt;$) but an optimizing</span><span>
</span><span id="line-715"></span><span>    </span><span class="hs-comment">-- liftA2, it would likely be better to define (*&gt;) using liftA2.</span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span>    </span><span class="hs-comment">-- | Sequence actions, discarding the value of the second argument.</span><span>
</span><span id="line-718"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-719"></span><span>    </span><span id="local-6989586621679482761"><span id="local-6989586621679482762"><span id="%3C%2A"><span class="annot"><a href="GHC.Base.html#%3C%2A"><span class="hs-operator hs-type">(&lt;*)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482762"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482761"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482760"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482762"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-720"></span><span>    </span><span id="local-6989586621679481643"><span class="annot"><a href="GHC.Base.html#%3C%2A"><span class="hs-operator hs-var hs-var">(&lt;*)</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; a) -&gt; f a -&gt; f b -&gt; f a
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span></span><span>
</span><span id="line-721"></span><span>
</span><span id="line-722"></span><span class="hs-comment">-- | A variant of '&lt;*&gt;' with the arguments reversed.</span><span>
</span><span id="line-723"></span><span class="hs-comment">--</span><span>
</span><span id="line-724"></span><span id="local-6989586621679482678"><span id="local-6989586621679482679"><span id="local-6989586621679482680"><span class="annot"><a href="GHC.Base.html#%3C%2A%2A%3E"><span class="hs-operator hs-type">(&lt;**&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482680"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482680"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482679"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482680"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482679"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482678"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482680"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482678"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-725"></span><span id="%3C%2A%2A%3E"><span class="annot"><span class="annottext">&lt;**&gt; :: forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f (a -&gt; b) -&gt; f b
</span><a href="GHC.Base.html#%3C%2A%2A%3E"><span class="hs-operator hs-var hs-var">(&lt;**&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; (a -&gt; b) -&gt; b) -&gt; f a -&gt; f (a -&gt; b) -&gt; f b
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679481639"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481639"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679481638"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481638"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481638"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481639"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-726"></span><span class="hs-comment">-- Don't use $ here, see the note at the top of the page</span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span class="hs-comment">-- | Lift a function to actions.</span><span>
</span><span id="line-729"></span><span class="hs-comment">-- Equivalent to Functor's `fmap` but implemented using only `Applicative`'s methods:</span><span>
</span><span id="line-730"></span><span class="hs-comment">-- `liftA f a = pure f &lt;*&gt; a`</span><span>
</span><span id="line-731"></span><span class="hs-comment">--</span><span>
</span><span id="line-732"></span><span class="hs-comment">-- As such this function may be used to implement a `Functor` instance from an `Applicative` one.</span><span>
</span><span id="line-733"></span><span>
</span><span id="line-734"></span><span class="hs-comment">--</span><span>
</span><span id="line-735"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-736"></span><span class="hs-comment">-- Using the Applicative instance for Lists:</span><span>
</span><span id="line-737"></span><span class="hs-comment">--</span><span>
</span><span id="line-738"></span><span class="hs-comment">-- &gt;&gt;&gt; liftA (+1) [1, 2]</span><span>
</span><span id="line-739"></span><span class="hs-comment">-- [2,3]</span><span>
</span><span id="line-740"></span><span class="hs-comment">--</span><span>
</span><span id="line-741"></span><span class="hs-comment">-- Or the Applicative instance for 'Maybe'</span><span>
</span><span id="line-742"></span><span class="hs-comment">--</span><span>
</span><span id="line-743"></span><span class="hs-comment">-- &gt;&gt;&gt; liftA (+1) (Just 3)</span><span>
</span><span id="line-744"></span><span class="hs-comment">-- Just 4</span><span>
</span><span id="line-745"></span><span>
</span><span id="line-746"></span><span id="local-6989586621679482672"><span id="local-6989586621679482673"><span id="local-6989586621679482674"><span class="annot"><a href="GHC.Base.html#liftA"><span class="hs-identifier hs-type">liftA</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482674"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482673"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482672"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482674"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482673"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482674"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482672"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-747"></span><span id="liftA"><span class="annot"><span class="annottext">liftA :: forall (f :: * -&gt; *) a b. Applicative f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#liftA"><span class="hs-identifier hs-var hs-var">liftA</span></a></span></span><span> </span><span id="local-6989586621679481633"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481633"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481632"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481632"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; f (a -&gt; b)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481633"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f (a -&gt; b) -&gt; f a -&gt; f b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481632"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-748"></span><span class="hs-comment">-- Caution: since this may be used for `fmap`, we can't use the obvious</span><span>
</span><span id="line-749"></span><span class="hs-comment">-- definition of liftA = fmap.</span><span>
</span><span id="line-750"></span><span>
</span><span id="line-751"></span><span class="hs-comment">-- | Lift a ternary function to actions.</span><span>
</span><span id="line-752"></span><span>
</span><span id="line-753"></span><span id="local-6989586621679482664"><span id="local-6989586621679482665"><span id="local-6989586621679482666"><span id="local-6989586621679482667"><span id="local-6989586621679482668"><span class="annot"><a href="GHC.Base.html#liftA3"><span class="hs-identifier hs-type">liftA3</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482668"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482667"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482666"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482665"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482664"><span class="hs-identifier hs-type">d</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482668"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482667"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482668"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482666"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482668"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482665"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482668"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482664"><span class="hs-identifier hs-type">d</span></a></span></span></span></span></span></span><span>
</span><span id="line-754"></span><span id="liftA3"><span class="annot"><span class="annottext">liftA3 :: forall (f :: * -&gt; *) a b c d.
Applicative f =&gt;
(a -&gt; b -&gt; c -&gt; d) -&gt; f a -&gt; f b -&gt; f c -&gt; f d
</span><a href="GHC.Base.html#liftA3"><span class="hs-identifier hs-var hs-var">liftA3</span></a></span></span><span> </span><span id="local-6989586621679481627"><span class="annot"><span class="annottext">a -&gt; b -&gt; c -&gt; d
</span><a href="#local-6989586621679481627"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481626"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481626"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679481625"><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679481625"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679481624"><span class="annot"><span class="annottext">f c
</span><a href="#local-6989586621679481624"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; c -&gt; d) -&gt; f a -&gt; f b -&gt; f (c -&gt; d)
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c -&gt; d
</span><a href="#local-6989586621679481627"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481626"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679481625"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">f (c -&gt; d) -&gt; f c -&gt; f d
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f c
</span><a href="#local-6989586621679481624"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-755"></span><span>
</span><span id="line-756"></span><span>
</span><span id="line-757"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA"><span class="hs-pragma hs-type">liftA</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-758"></span><span id="local-6989586621679481622"><span id="local-6989586621679481623"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA"><span class="hs-pragma hs-type">liftA</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481623"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481622"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481623"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481622"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-759"></span><span id="local-6989586621679481620"><span id="local-6989586621679481621"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA"><span class="hs-pragma hs-type">liftA</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481621"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481620"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481621"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481620"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-760"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA3"><span class="hs-pragma hs-type">liftA3</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-761"></span><span id="local-6989586621679481616"><span id="local-6989586621679481617"><span id="local-6989586621679481618"><span id="local-6989586621679481619"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA3"><span class="hs-pragma hs-type">liftA3</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481619"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481618"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481617"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481616"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481619"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481618"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481617"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481616"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-762"></span><span id="local-6989586621679481612"><span id="local-6989586621679481613"><span id="local-6989586621679481614"><span id="local-6989586621679481615"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA3"><span class="hs-pragma hs-type">liftA3</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481615"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481614"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481613"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481612"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span>
</span><span id="line-763"></span><span>                                </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481615"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481614"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481613"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481612"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-764"></span><span>
</span><span id="line-765"></span><span class="hs-comment">-- | The 'join' function is the conventional monad join operator. It</span><span>
</span><span id="line-766"></span><span class="hs-comment">-- is used to remove one level of monadic structure, projecting its</span><span>
</span><span id="line-767"></span><span class="hs-comment">-- bound argument into the outer level.</span><span>
</span><span id="line-768"></span><span class="hs-comment">--</span><span>
</span><span id="line-769"></span><span class="hs-comment">--</span><span>
</span><span id="line-770"></span><span class="hs-comment">-- \'@'join' bss@\' can be understood as the @do@ expression</span><span>
</span><span id="line-771"></span><span class="hs-comment">--</span><span>
</span><span id="line-772"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-773"></span><span class="hs-comment">-- do bs &lt;- bss</span><span>
</span><span id="line-774"></span><span class="hs-comment">--    bs</span><span>
</span><span id="line-775"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-776"></span><span class="hs-comment">--</span><span>
</span><span id="line-777"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-778"></span><span class="hs-comment">--</span><span>
</span><span id="line-779"></span><span class="hs-comment">-- A common use of 'join' is to run an 'IO' computation returned from</span><span>
</span><span id="line-780"></span><span class="hs-comment">-- an 'GHC.Conc.STM' transaction, since 'GHC.Conc.STM' transactions</span><span>
</span><span id="line-781"></span><span class="hs-comment">-- can't perform 'IO' directly. Recall that</span><span>
</span><span id="line-782"></span><span class="hs-comment">--</span><span>
</span><span id="line-783"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-784"></span><span class="hs-comment">-- 'GHC.Conc.atomically' :: STM a -&gt; IO a</span><span>
</span><span id="line-785"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-786"></span><span class="hs-comment">--</span><span>
</span><span id="line-787"></span><span class="hs-comment">-- is used to run 'GHC.Conc.STM' transactions atomically. So, by</span><span>
</span><span id="line-788"></span><span class="hs-comment">-- specializing the types of 'GHC.Conc.atomically' and 'join' to</span><span>
</span><span id="line-789"></span><span class="hs-comment">--</span><span>
</span><span id="line-790"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-791"></span><span class="hs-comment">-- 'GHC.Conc.atomically' :: STM (IO b) -&gt; IO (IO b)</span><span>
</span><span id="line-792"></span><span class="hs-comment">-- 'join'       :: IO (IO b)  -&gt; IO b</span><span>
</span><span id="line-793"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-794"></span><span class="hs-comment">--</span><span>
</span><span id="line-795"></span><span class="hs-comment">-- we can compose them as</span><span>
</span><span id="line-796"></span><span class="hs-comment">--</span><span>
</span><span id="line-797"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-798"></span><span class="hs-comment">-- 'join' . 'GHC.Conc.atomically' :: STM (IO b) -&gt; IO b</span><span>
</span><span id="line-799"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-800"></span><span class="hs-comment">--</span><span>
</span><span id="line-801"></span><span class="hs-comment">-- to run an 'GHC.Conc.STM' transaction and the 'IO' action it</span><span>
</span><span id="line-802"></span><span class="hs-comment">-- returns.</span><span>
</span><span id="line-803"></span><span id="local-6989586621679482657"><span id="local-6989586621679482658"><span class="annot"><a href="GHC.Base.html#join"><span class="hs-identifier hs-type">join</span></a></span><span>              </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482658"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482658"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482658"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482657"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482658"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482657"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-804"></span><span id="join"><span class="annot"><span class="annottext">join :: forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="GHC.Base.html#join"><span class="hs-identifier hs-var hs-var">join</span></a></span></span><span> </span><span id="local-6989586621679481609"><span class="annot"><span class="annottext">m (m a)
</span><a href="#local-6989586621679481609"><span class="hs-identifier hs-var">x</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">m (m a)
</span><a href="#local-6989586621679481609"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m (m a) -&gt; (m a -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
forall a. a -&gt; a
</span><a href="GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-805"></span><span>
</span><span id="line-806"></span><span class="hs-comment">{- | The 'Monad' class defines the basic operations over a /monad/,
a concept from a branch of mathematics known as /category theory/.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an /abstract datatype/ of actions.
Haskell's @do@ expressions provide a convenient syntax for writing
monadic expressions.

Instances of 'Monad' should satisfy the following:

[Left identity]  @'return' a '&gt;&gt;=' k  =  k a@
[Right identity] @m '&gt;&gt;=' 'return'  =  m@
[Associativity]  @m '&gt;&gt;=' (\\x -&gt; k x '&gt;&gt;=' h)  =  (m '&gt;&gt;=' k) '&gt;&gt;=' h@

Furthermore, the 'Monad' and 'Applicative' operations should relate as follows:

* @'pure' = 'return'@
* @m1 '&lt;*&gt;' m2 = m1 '&gt;&gt;=' (\x1 -&gt; m2 '&gt;&gt;=' (\x2 -&gt; 'return' (x1 x2)))@

The above laws imply:

* @'fmap' f xs  =  xs '&gt;&gt;=' 'return' . f@
* @('&gt;&gt;') = ('*&gt;')@

and that 'pure' and ('&lt;*&gt;') satisfy the applicative functor laws.

The instances of 'Monad' for lists, 'Data.Maybe.Maybe' and 'System.IO.IO'
defined in the &quot;Prelude&quot; satisfy these laws.
-}</span><span>
</span><span id="line-834"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Monad"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-var">Monad</span></a></span></span><span> </span><span id="local-6989586621679482742"><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-835"></span><span>    </span><span class="hs-comment">-- | Sequentially compose two actions, passing any value produced</span><span>
</span><span id="line-836"></span><span>    </span><span class="hs-comment">-- by the first as an argument to the second.</span><span>
</span><span id="line-837"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-838"></span><span>    </span><span class="hs-comment">-- \'@as '&gt;&gt;=' bs@\' can be understood as the @do@ expression</span><span>
</span><span id="line-839"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-840"></span><span>    </span><span class="hs-comment">-- @</span><span>
</span><span id="line-841"></span><span>    </span><span class="hs-comment">-- do a &lt;- as</span><span>
</span><span id="line-842"></span><span>    </span><span class="hs-comment">--    bs a</span><span>
</span><span id="line-843"></span><span>    </span><span class="hs-comment">-- @</span><span>
</span><span id="line-844"></span><span>    </span><span id="%3E%3E%3D"><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-type">(&gt;&gt;=)</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679482744"><span class="annot"><a href="#local-6989586621679482744"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679482743"><span class="annot"><a href="#local-6989586621679482743"><span class="hs-identifier hs-type">b</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482744"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482744"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482743"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482743"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-845"></span><span>
</span><span id="line-846"></span><span>    </span><span class="hs-comment">-- | Sequentially compose two actions, discarding any value produced</span><span>
</span><span id="line-847"></span><span>    </span><span class="hs-comment">-- by the first, like sequencing operators (such as the semicolon)</span><span>
</span><span id="line-848"></span><span>    </span><span class="hs-comment">-- in imperative languages.</span><span>
</span><span id="line-849"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-850"></span><span>    </span><span class="hs-comment">-- \'@as '&gt;&gt;' bs@\' can be understood as the @do@ expression</span><span>
</span><span id="line-851"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-852"></span><span>    </span><span class="hs-comment">-- @</span><span>
</span><span id="line-853"></span><span>    </span><span class="hs-comment">-- do as</span><span>
</span><span id="line-854"></span><span>    </span><span class="hs-comment">--    bs</span><span>
</span><span id="line-855"></span><span>    </span><span class="hs-comment">-- @</span><span>
</span><span id="line-856"></span><span>    </span><span id="%3E%3E"><span class="annot"><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-type">(&gt;&gt;)</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679482741"><span class="annot"><a href="#local-6989586621679482741"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679482740"><span class="annot"><a href="#local-6989586621679482740"><span class="hs-identifier hs-type">b</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482741"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482740"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482740"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-857"></span><span>    </span><span id="local-6989586621679481606"><span id="local-6989586621679481604"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679481604"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var hs-var">&gt;&gt;</span></a></span><span> </span><span id="local-6989586621679481603"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679481603"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679481604"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679481603"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-comment">-- See Note [Recursive bindings for Applicative/Monad]</span><span>
</span><span id="line-858"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-859"></span><span>
</span><span id="line-860"></span><span>    </span><span class="hs-comment">-- | Inject a value into the monadic type.</span><span>
</span><span id="line-861"></span><span>    </span><span id="local-6989586621679482739"><span id="return"><span class="annot"><a href="GHC.Base.html#return"><span class="hs-identifier hs-type">return</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482739"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482742"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482739"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-862"></span><span>    </span><span id="local-6989586621679481602"><span class="annot"><a href="GHC.Base.html#return"><span class="hs-identifier hs-var hs-var">return</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span></span><span>
</span><span id="line-863"></span><span>
</span><span id="line-864"></span><span class="hs-comment">{- Note [Recursive bindings for Applicative/Monad]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The original Applicative/Monad proposal stated that after
implementation, the designated implementation of (&gt;&gt;) would become

  (&gt;&gt;) :: forall a b. m a -&gt; m b -&gt; m b
  (&gt;&gt;) = (*&gt;)

by default. You might be inclined to change this to reflect the stated
proposal, but you really shouldn't! Why? Because people tend to define
such instances the /other/ way around: in particular, it is perfectly
legitimate to define an instance of Applicative (*&gt;) in terms of (&gt;&gt;),
which would lead to an infinite loop for the default implementation of
Monad! And people do this in the wild.

This turned into a nasty bug that was tricky to track down, and rather
than eliminate it everywhere upstream, it's easier to just retain the
original default.

-}</span><span>
</span><span id="line-885"></span><span>
</span><span id="line-886"></span><span class="hs-comment">-- | Same as '&gt;&gt;=', but with the arguments interchanged.</span><span>
</span><span id="line-887"></span><span id="local-6989586621679481598"><span id="local-6989586621679481599"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">=&lt;&lt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481599"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="hs-pragma">[</span><span class="annot"><a href="#local-6989586621679481598"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">]</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="hs-pragma">[</span><span class="annot"><a href="#local-6989586621679481599"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="hs-pragma">[</span><span class="annot"><a href="#local-6989586621679481598"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-888"></span><span id="local-6989586621679482649"><span id="local-6989586621679482650"><span id="local-6989586621679482651"><span class="annot"><a href="GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-type">(=&lt;&lt;)</span></a></span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482651"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482650"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482651"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482649"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482651"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482650"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482651"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482649"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-889"></span><span id="local-6989586621679481595"><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679481595"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="%3D%3C%3C"><span class="annot"><span class="annottext">=&lt;&lt; :: forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var hs-var">=&lt;&lt;</span></a></span></span><span> </span><span id="local-6989586621679481594"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679481594"><span class="hs-identifier hs-var">x</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679481594"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679481595"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-890"></span><span>
</span><span id="line-891"></span><span class="hs-comment">-- | Conditional execution of 'Applicative' expressions. For example,</span><span>
</span><span id="line-892"></span><span class="hs-comment">--</span><span>
</span><span id="line-893"></span><span class="hs-comment">-- &gt; when debug (putStrLn &quot;Debugging&quot;)</span><span>
</span><span id="line-894"></span><span class="hs-comment">--</span><span>
</span><span id="line-895"></span><span class="hs-comment">-- will output the string @Debugging@ if the Boolean value @debug@</span><span>
</span><span id="line-896"></span><span class="hs-comment">-- is 'True', and otherwise do nothing.</span><span>
</span><span id="line-897"></span><span id="local-6989586621679482645"><span class="annot"><a href="GHC.Base.html#when"><span class="hs-identifier hs-type">when</span></a></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482645"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482645"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482645"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-898"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#when"><span class="hs-pragma hs-type">when</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-899"></span><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#when"><span class="hs-pragma hs-type">when</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-pragma hs-type">Bool</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-900"></span><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#when"><span class="hs-pragma hs-type">when</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-pragma hs-type">Bool</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-901"></span><span id="when"><span class="annot"><span class="annottext">when :: forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="GHC.Base.html#when"><span class="hs-identifier hs-var hs-var">when</span></a></span></span><span> </span><span id="local-6989586621679481590"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679481590"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679481589"><span class="annot"><span class="annottext">f ()
</span><a href="#local-6989586621679481589"><span class="hs-identifier hs-var">s</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679481590"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">f ()
</span><a href="#local-6989586621679481589"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">() -&gt; f ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-902"></span><span>
</span><span id="line-903"></span><span class="hs-comment">-- | Evaluate each action in the sequence from left to right,</span><span>
</span><span id="line-904"></span><span class="hs-comment">-- and collect the results.</span><span>
</span><span id="line-905"></span><span id="local-6989586621679482642"><span id="local-6989586621679482643"><span class="annot"><a href="GHC.Base.html#sequence"><span class="hs-identifier hs-type">sequence</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482643"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482643"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482642"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482643"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482642"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-906"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#sequence"><span class="hs-pragma hs-type">sequence</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-907"></span><span id="sequence"><span class="annot"><span class="annottext">sequence :: forall (m :: * -&gt; *) a. Monad m =&gt; [m a] -&gt; m [a]
</span><a href="GHC.Base.html#sequence"><span class="hs-identifier hs-var hs-var">sequence</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; [m a] -&gt; m [a]
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Base.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
forall a. a -&gt; a
</span><a href="GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-908"></span><span class="hs-comment">-- Note: [sequence and mapM]</span><span>
</span><span id="line-909"></span><span>
</span><span id="line-910"></span><span class="hs-comment">-- | @'mapM' f@ is equivalent to @'sequence' . 'map' f@.</span><span>
</span><span id="line-911"></span><span id="local-6989586621679482637"><span id="local-6989586621679482638"><span id="local-6989586621679482639"><span class="annot"><a href="GHC.Base.html#mapM"><span class="hs-identifier hs-type">mapM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482639"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482638"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482639"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482637"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482638"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482639"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482637"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span></span></span></span><span>
</span><span id="line-912"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#mapM"><span class="hs-pragma hs-type">mapM</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-913"></span><span id="mapM"><span class="annot"><span class="annottext">mapM :: forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Base.html#mapM"><span class="hs-identifier hs-var hs-var">mapM</span></a></span></span><span> </span><span id="local-6989586621679481582"><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679481582"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481581"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481581"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m [b] -&gt; m [b]) -&gt; m [b] -&gt; [a] -&gt; m [b]
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m [b] -&gt; m [b]
</span><a href="#local-6989586621679481580"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[b] -&gt; m [b]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481581"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-914"></span><span>            </span><span class="hs-keyword">where</span><span>
</span><span id="line-915"></span><span>              </span><span id="local-6989586621679481580"><span class="annot"><span class="annottext">k :: a -&gt; m [b] -&gt; m [b]
</span><a href="#local-6989586621679481580"><span class="hs-identifier hs-var hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679481576"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481576"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679481575"><span class="annot"><span class="annottext">m [b]
</span><a href="#local-6989586621679481575"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679481574"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481574"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; m b
</span><a href="#local-6989586621679481582"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481576"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481573"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481573"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m [b]
</span><a href="#local-6989586621679481575"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[b] -&gt; m [b]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481574"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; [b]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481573"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-916"></span><span>
</span><span id="line-917"></span><span class="hs-comment">{-
Note: [sequence and mapM]
~~~~~~~~~~~~~~~~~~~~~~~~~
Originally, we defined

mapM f = sequence . map f

This relied on list fusion to produce efficient code for mapM, and led to
excessive allocation in cryptarithm2. Defining

sequence = mapM id

relies only on inlining a tiny function (id) and beta reduction, which tends to
be a more reliable aspect of simplification. Indeed, this does not lead to
similar problems in nofib.
-}</span><span>
</span><span id="line-933"></span><span>
</span><span id="line-934"></span><span class="hs-comment">-- | Promote a function to a monad.</span><span>
</span><span id="line-935"></span><span id="local-6989586621679482631"><span id="local-6989586621679482632"><span id="local-6989586621679482633"><span class="annot"><a href="GHC.Base.html#liftM"><span class="hs-identifier hs-type">liftM</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482633"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482632"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482631"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482633"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482632"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482633"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482631"><span class="hs-identifier hs-type">r</span></a></span></span></span></span><span>
</span><span id="line-936"></span><span id="liftM"><span class="annot"><span class="annottext">liftM :: forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="GHC.Base.html#liftM"><span class="hs-identifier hs-var hs-var">liftM</span></a></span></span><span> </span><span id="local-6989586621679481568"><span class="annot"><span class="annottext">a1 -&gt; r
</span><a href="#local-6989586621679481568"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481567"><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481567"><span class="hs-identifier hs-var">m1</span></a></span></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679481566"><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481566"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481567"><span class="hs-identifier hs-var">m1</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">r -&gt; m r
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a1 -&gt; r
</span><a href="#local-6989586621679481568"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481566"><span class="hs-identifier hs-var">x1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-937"></span><span>
</span><span id="line-938"></span><span class="hs-comment">-- | Promote a function to a monad, scanning the monadic arguments from</span><span>
</span><span id="line-939"></span><span class="hs-comment">-- left to right.  For example,</span><span>
</span><span id="line-940"></span><span class="hs-comment">--</span><span>
</span><span id="line-941"></span><span class="hs-comment">-- &gt; liftM2 (+) [0,1] [0,2] = [0,2,1,3]</span><span>
</span><span id="line-942"></span><span class="hs-comment">-- &gt; liftM2 (+) (Just 1) Nothing = Nothing</span><span>
</span><span id="line-943"></span><span class="hs-comment">--</span><span>
</span><span id="line-944"></span><span id="local-6989586621679482624"><span id="local-6989586621679482625"><span id="local-6989586621679482626"><span id="local-6989586621679482627"><span class="annot"><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-type">liftM2</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482627"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482626"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482625"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482624"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482627"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482626"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482627"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482625"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482627"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482624"><span class="hs-identifier hs-type">r</span></a></span></span></span></span></span><span>
</span><span id="line-945"></span><span id="liftM2"><span class="annot"><span class="annottext">liftM2 :: forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-var hs-var">liftM2</span></a></span></span><span> </span><span id="local-6989586621679481560"><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; r
</span><a href="#local-6989586621679481560"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481559"><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481559"><span class="hs-identifier hs-var">m1</span></a></span></span><span> </span><span id="local-6989586621679481558"><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481558"><span class="hs-identifier hs-var">m2</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679481557"><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481557"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481559"><span class="hs-identifier hs-var">m1</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481556"><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481556"><span class="hs-identifier hs-var">x2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481558"><span class="hs-identifier hs-var">m2</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">r -&gt; m r
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; r
</span><a href="#local-6989586621679481560"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481557"><span class="hs-identifier hs-var">x1</span></a></span><span> </span><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481556"><span class="hs-identifier hs-var">x2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-946"></span><span class="hs-comment">-- Caution: since this may be used for `liftA2`, we can't use the obvious</span><span>
</span><span id="line-947"></span><span class="hs-comment">-- definition of liftM2 = liftA2.</span><span>
</span><span id="line-948"></span><span>
</span><span id="line-949"></span><span class="hs-comment">-- | Promote a function to a monad, scanning the monadic arguments from</span><span>
</span><span id="line-950"></span><span class="hs-comment">-- left to right (cf. 'liftM2').</span><span>
</span><span id="line-951"></span><span id="local-6989586621679482615"><span id="local-6989586621679482616"><span id="local-6989586621679482617"><span id="local-6989586621679482618"><span id="local-6989586621679482619"><span class="annot"><a href="GHC.Base.html#liftM3"><span class="hs-identifier hs-type">liftM3</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482619"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482618"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482617"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482616"><span class="hs-identifier hs-type">a3</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482615"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482619"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482618"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482619"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482617"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482619"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482616"><span class="hs-identifier hs-type">a3</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482619"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482615"><span class="hs-identifier hs-type">r</span></a></span></span></span></span></span></span><span>
</span><span id="line-952"></span><span id="liftM3"><span class="annot"><span class="annottext">liftM3 :: forall (m :: * -&gt; *) a1 a2 a3 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; a3 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m a3 -&gt; m r
</span><a href="GHC.Base.html#liftM3"><span class="hs-identifier hs-var hs-var">liftM3</span></a></span></span><span> </span><span id="local-6989586621679481549"><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; a3 -&gt; r
</span><a href="#local-6989586621679481549"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481548"><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481548"><span class="hs-identifier hs-var">m1</span></a></span></span><span> </span><span id="local-6989586621679481547"><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481547"><span class="hs-identifier hs-var">m2</span></a></span></span><span> </span><span id="local-6989586621679481546"><span class="annot"><span class="annottext">m a3
</span><a href="#local-6989586621679481546"><span class="hs-identifier hs-var">m3</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679481545"><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481545"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481548"><span class="hs-identifier hs-var">m1</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481544"><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481544"><span class="hs-identifier hs-var">x2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481547"><span class="hs-identifier hs-var">m2</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481543"><span class="annot"><span class="annottext">a3
</span><a href="#local-6989586621679481543"><span class="hs-identifier hs-var">x3</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a3
</span><a href="#local-6989586621679481546"><span class="hs-identifier hs-var">m3</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">r -&gt; m r
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; a3 -&gt; r
</span><a href="#local-6989586621679481549"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481545"><span class="hs-identifier hs-var">x1</span></a></span><span> </span><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481544"><span class="hs-identifier hs-var">x2</span></a></span><span> </span><span class="annot"><span class="annottext">a3
</span><a href="#local-6989586621679481543"><span class="hs-identifier hs-var">x3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-953"></span><span>
</span><span id="line-954"></span><span class="hs-comment">-- | Promote a function to a monad, scanning the monadic arguments from</span><span>
</span><span id="line-955"></span><span class="hs-comment">-- left to right (cf. 'liftM2').</span><span>
</span><span id="line-956"></span><span id="local-6989586621679482604"><span id="local-6989586621679482605"><span id="local-6989586621679482606"><span id="local-6989586621679482607"><span id="local-6989586621679482608"><span id="local-6989586621679482609"><span class="annot"><a href="GHC.Base.html#liftM4"><span class="hs-identifier hs-type">liftM4</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482609"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482608"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482607"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482606"><span class="hs-identifier hs-type">a3</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482605"><span class="hs-identifier hs-type">a4</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482604"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482609"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482608"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482609"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482607"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482609"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482606"><span class="hs-identifier hs-type">a3</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482609"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482605"><span class="hs-identifier hs-type">a4</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482609"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482604"><span class="hs-identifier hs-type">r</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-957"></span><span id="liftM4"><span class="annot"><span class="annottext">liftM4 :: forall (m :: * -&gt; *) a1 a2 a3 a4 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; a3 -&gt; a4 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m a3 -&gt; m a4 -&gt; m r
</span><a href="GHC.Base.html#liftM4"><span class="hs-identifier hs-var hs-var">liftM4</span></a></span></span><span> </span><span id="local-6989586621679481535"><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; a3 -&gt; a4 -&gt; r
</span><a href="#local-6989586621679481535"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481534"><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481534"><span class="hs-identifier hs-var">m1</span></a></span></span><span> </span><span id="local-6989586621679481533"><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481533"><span class="hs-identifier hs-var">m2</span></a></span></span><span> </span><span id="local-6989586621679481532"><span class="annot"><span class="annottext">m a3
</span><a href="#local-6989586621679481532"><span class="hs-identifier hs-var">m3</span></a></span></span><span> </span><span id="local-6989586621679481531"><span class="annot"><span class="annottext">m a4
</span><a href="#local-6989586621679481531"><span class="hs-identifier hs-var">m4</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679481530"><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481530"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481534"><span class="hs-identifier hs-var">m1</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481529"><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481529"><span class="hs-identifier hs-var">x2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481533"><span class="hs-identifier hs-var">m2</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481528"><span class="annot"><span class="annottext">a3
</span><a href="#local-6989586621679481528"><span class="hs-identifier hs-var">x3</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a3
</span><a href="#local-6989586621679481532"><span class="hs-identifier hs-var">m3</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481527"><span class="annot"><span class="annottext">a4
</span><a href="#local-6989586621679481527"><span class="hs-identifier hs-var">x4</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a4
</span><a href="#local-6989586621679481531"><span class="hs-identifier hs-var">m4</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">r -&gt; m r
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; a3 -&gt; a4 -&gt; r
</span><a href="#local-6989586621679481535"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481530"><span class="hs-identifier hs-var">x1</span></a></span><span> </span><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481529"><span class="hs-identifier hs-var">x2</span></a></span><span> </span><span class="annot"><span class="annottext">a3
</span><a href="#local-6989586621679481528"><span class="hs-identifier hs-var">x3</span></a></span><span> </span><span class="annot"><span class="annottext">a4
</span><a href="#local-6989586621679481527"><span class="hs-identifier hs-var">x4</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-958"></span><span>
</span><span id="line-959"></span><span class="hs-comment">-- | Promote a function to a monad, scanning the monadic arguments from</span><span>
</span><span id="line-960"></span><span class="hs-comment">-- left to right (cf. 'liftM2').</span><span>
</span><span id="line-961"></span><span id="local-6989586621679482591"><span id="local-6989586621679482592"><span id="local-6989586621679482593"><span id="local-6989586621679482594"><span id="local-6989586621679482595"><span id="local-6989586621679482596"><span id="local-6989586621679482597"><span class="annot"><a href="GHC.Base.html#liftM5"><span class="hs-identifier hs-type">liftM5</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482597"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482596"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482595"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482594"><span class="hs-identifier hs-type">a3</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482593"><span class="hs-identifier hs-type">a4</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482592"><span class="hs-identifier hs-type">a5</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482591"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482597"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482596"><span class="hs-identifier hs-type">a1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482597"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482595"><span class="hs-identifier hs-type">a2</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482597"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482594"><span class="hs-identifier hs-type">a3</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482597"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482593"><span class="hs-identifier hs-type">a4</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482597"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482592"><span class="hs-identifier hs-type">a5</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482597"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482591"><span class="hs-identifier hs-type">r</span></a></span></span></span></span></span></span></span></span><span>
</span><span id="line-962"></span><span id="liftM5"><span class="annot"><span class="annottext">liftM5 :: forall (m :: * -&gt; *) a1 a2 a3 a4 a5 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; a3 -&gt; a4 -&gt; a5 -&gt; r)
-&gt; m a1 -&gt; m a2 -&gt; m a3 -&gt; m a4 -&gt; m a5 -&gt; m r
</span><a href="GHC.Base.html#liftM5"><span class="hs-identifier hs-var hs-var">liftM5</span></a></span></span><span> </span><span id="local-6989586621679481518"><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; a3 -&gt; a4 -&gt; a5 -&gt; r
</span><a href="#local-6989586621679481518"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481517"><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481517"><span class="hs-identifier hs-var">m1</span></a></span></span><span> </span><span id="local-6989586621679481516"><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481516"><span class="hs-identifier hs-var">m2</span></a></span></span><span> </span><span id="local-6989586621679481515"><span class="annot"><span class="annottext">m a3
</span><a href="#local-6989586621679481515"><span class="hs-identifier hs-var">m3</span></a></span></span><span> </span><span id="local-6989586621679481514"><span class="annot"><span class="annottext">m a4
</span><a href="#local-6989586621679481514"><span class="hs-identifier hs-var">m4</span></a></span></span><span> </span><span id="local-6989586621679481513"><span class="annot"><span class="annottext">m a5
</span><a href="#local-6989586621679481513"><span class="hs-identifier hs-var">m5</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679481512"><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481512"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a1
</span><a href="#local-6989586621679481517"><span class="hs-identifier hs-var">m1</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481511"><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481511"><span class="hs-identifier hs-var">x2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a2
</span><a href="#local-6989586621679481516"><span class="hs-identifier hs-var">m2</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481510"><span class="annot"><span class="annottext">a3
</span><a href="#local-6989586621679481510"><span class="hs-identifier hs-var">x3</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a3
</span><a href="#local-6989586621679481515"><span class="hs-identifier hs-var">m3</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481509"><span class="annot"><span class="annottext">a4
</span><a href="#local-6989586621679481509"><span class="hs-identifier hs-var">x4</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a4
</span><a href="#local-6989586621679481514"><span class="hs-identifier hs-var">m4</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481508"><span class="annot"><span class="annottext">a5
</span><a href="#local-6989586621679481508"><span class="hs-identifier hs-var">x5</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a5
</span><a href="#local-6989586621679481513"><span class="hs-identifier hs-var">m5</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">r -&gt; m r
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a1 -&gt; a2 -&gt; a3 -&gt; a4 -&gt; a5 -&gt; r
</span><a href="#local-6989586621679481518"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a1
</span><a href="#local-6989586621679481512"><span class="hs-identifier hs-var">x1</span></a></span><span> </span><span class="annot"><span class="annottext">a2
</span><a href="#local-6989586621679481511"><span class="hs-identifier hs-var">x2</span></a></span><span> </span><span class="annot"><span class="annottext">a3
</span><a href="#local-6989586621679481510"><span class="hs-identifier hs-var">x3</span></a></span><span> </span><span class="annot"><span class="annottext">a4
</span><a href="#local-6989586621679481509"><span class="hs-identifier hs-var">x4</span></a></span><span> </span><span class="annot"><span class="annottext">a5
</span><a href="#local-6989586621679481508"><span class="hs-identifier hs-var">x5</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-963"></span><span>
</span><span id="line-964"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM"><span class="hs-pragma hs-type">liftM</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-965"></span><span id="local-6989586621679481506"><span id="local-6989586621679481507"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM"><span class="hs-pragma hs-type">liftM</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481507"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481506"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481507"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481506"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-966"></span><span id="local-6989586621679481504"><span id="local-6989586621679481505"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM"><span class="hs-pragma hs-type">liftM</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481505"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481504"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481505"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481504"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-967"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM2"><span class="hs-pragma hs-type">liftM2</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-968"></span><span id="local-6989586621679481501"><span id="local-6989586621679481502"><span id="local-6989586621679481503"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM2"><span class="hs-pragma hs-type">liftM2</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481503"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481502"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481501"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481503"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481502"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481501"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span><span>
</span><span id="line-969"></span><span id="local-6989586621679481498"><span id="local-6989586621679481499"><span id="local-6989586621679481500"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM2"><span class="hs-pragma hs-type">liftM2</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481500"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481499"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481498"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481500"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481499"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481498"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span><span>
</span><span id="line-970"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM3"><span class="hs-pragma hs-type">liftM3</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-971"></span><span id="local-6989586621679481494"><span id="local-6989586621679481495"><span id="local-6989586621679481496"><span id="local-6989586621679481497"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM3"><span class="hs-pragma hs-type">liftM3</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481497"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481496"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481495"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481494"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481497"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481496"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481495"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481494"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-972"></span><span id="local-6989586621679481490"><span id="local-6989586621679481491"><span id="local-6989586621679481492"><span id="local-6989586621679481493"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM3"><span class="hs-pragma hs-type">liftM3</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481493"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481492"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481491"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481490"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481493"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481492"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481491"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481490"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span><span>
</span><span id="line-973"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM4"><span class="hs-pragma hs-type">liftM4</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-974"></span><span id="local-6989586621679481485"><span id="local-6989586621679481486"><span id="local-6989586621679481487"><span id="local-6989586621679481488"><span id="local-6989586621679481489"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM4"><span class="hs-pragma hs-type">liftM4</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481489"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481488"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481487"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481486"><span class="hs-pragma hs-type">a4</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481485"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481489"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481488"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481487"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481486"><span class="hs-pragma hs-type">a4</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481485"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span></span><span>
</span><span id="line-975"></span><span id="local-6989586621679481480"><span id="local-6989586621679481481"><span id="local-6989586621679481482"><span id="local-6989586621679481483"><span id="local-6989586621679481484"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM4"><span class="hs-pragma hs-type">liftM4</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481484"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481483"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481482"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481481"><span class="hs-pragma hs-type">a4</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481480"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481484"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481483"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481482"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481481"><span class="hs-pragma hs-type">a4</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481480"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span></span><span>
</span><span id="line-976"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM5"><span class="hs-pragma hs-type">liftM5</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-977"></span><span id="local-6989586621679481474"><span id="local-6989586621679481475"><span id="local-6989586621679481476"><span id="local-6989586621679481477"><span id="local-6989586621679481478"><span id="local-6989586621679481479"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM5"><span class="hs-pragma hs-type">liftM5</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481479"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481478"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481477"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481476"><span class="hs-pragma hs-type">a4</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481475"><span class="hs-pragma hs-type">a5</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481474"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481479"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481478"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481477"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481476"><span class="hs-pragma hs-type">a4</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481475"><span class="hs-pragma hs-type">a5</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481474"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span></span></span><span>
</span><span id="line-978"></span><span id="local-6989586621679481468"><span id="local-6989586621679481469"><span id="local-6989586621679481470"><span id="local-6989586621679481471"><span id="local-6989586621679481472"><span id="local-6989586621679481473"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftM5"><span class="hs-pragma hs-type">liftM5</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481473"><span class="hs-pragma hs-type">a1</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481472"><span class="hs-pragma hs-type">a2</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481471"><span class="hs-pragma hs-type">a3</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481470"><span class="hs-pragma hs-type">a4</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481469"><span class="hs-pragma hs-type">a5</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481468"><span class="hs-pragma hs-type">r</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481473"><span class="hs-pragma hs-type">a1</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481472"><span class="hs-pragma hs-type">a2</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481471"><span class="hs-pragma hs-type">a3</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481470"><span class="hs-pragma hs-type">a4</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481469"><span class="hs-pragma hs-type">a5</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481468"><span class="hs-pragma hs-type">r</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span></span></span></span></span><span>
</span><span id="line-979"></span><span>
</span><span id="line-980"></span><span class="hs-comment">{- | In many situations, the 'liftM' operations can be replaced by uses of
'ap', which promotes function application.

&gt; return f `ap` x1 `ap` ... `ap` xn

is equivalent to

&gt; liftMn f x1 x2 ... xn

-}</span><span>
</span><span id="line-990"></span><span>
</span><span id="line-991"></span><span id="local-6989586621679482581"><span id="local-6989586621679482582"><span id="local-6989586621679482583"><span class="annot"><a href="GHC.Base.html#ap"><span class="hs-identifier hs-type">ap</span></a></span><span>                </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482583"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482583"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482582"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482581"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482583"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482582"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482583"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482581"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-992"></span><span id="ap"><span class="annot"><span class="annottext">ap :: forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#ap"><span class="hs-identifier hs-var hs-var">ap</span></a></span></span><span> </span><span id="local-6989586621679481462"><span class="annot"><span class="annottext">m (a -&gt; b)
</span><a href="#local-6989586621679481462"><span class="hs-identifier hs-var">m1</span></a></span></span><span> </span><span id="local-6989586621679481461"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679481461"><span class="hs-identifier hs-var">m2</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679481460"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481460"><span class="hs-identifier hs-var">x1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (a -&gt; b)
</span><a href="#local-6989586621679481462"><span class="hs-identifier hs-var">m1</span></a></span><span class="hs-special">;</span><span> </span><span id="local-6989586621679481459"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481459"><span class="hs-identifier hs-var">x2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679481461"><span class="hs-identifier hs-var">m2</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">b -&gt; m b
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481460"><span class="hs-identifier hs-var">x1</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481459"><span class="hs-identifier hs-var">x2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-993"></span><span class="hs-comment">-- Since many Applicative instances define (&lt;*&gt;) = ap, we</span><span>
</span><span id="line-994"></span><span class="hs-comment">-- cannot define ap = (&lt;*&gt;)</span><span>
</span><span id="line-995"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Base.html#ap"><span class="hs-pragma hs-type">ap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-996"></span><span id="local-6989586621679481457"><span id="local-6989586621679481458"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#ap"><span class="hs-pragma hs-type">ap</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481458"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481457"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481458"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-pragma hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481457"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-997"></span><span id="local-6989586621679481455"><span id="local-6989586621679481456"><span class="hs-pragma">{-# SPECIALISE</span><span> </span><span class="annot"><a href="GHC.Base.html#ap"><span class="hs-pragma hs-type">ap</span></a></span><span> </span><span class="hs-pragma">::</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481456"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481455"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481456"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-pragma hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481455"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">#-}</span></span></span><span>
</span><span id="line-998"></span><span>
</span><span id="line-999"></span><span class="hs-comment">-- instances for Prelude types</span><span>
</span><span id="line-1000"></span><span>
</span><span id="line-1001"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1002"></span><span id="local-6989586621679482577"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481452"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482577"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1003"></span><span>    </span><span id="local-6989586621679481451"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; (r -&gt; a) -&gt; r -&gt; b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; (r -&gt; a) -&gt; r -&gt; b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">(.)</span></a></span></span><span>
</span><span id="line-1004"></span><span>
</span><span id="line-1005"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1006"></span><span id="local-6989586621679482574"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481442"><span id="local-6989586621679481444"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482574"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1007"></span><span>    </span><span id="local-6989586621679481441"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; r -&gt; a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; r -&gt; a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span>
</span><span id="line-1008"></span><span>    </span><span id="local-6989586621679481440"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. (r -&gt; (a -&gt; b)) -&gt; (r -&gt; a) -&gt; r -&gt; b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span id="local-6989586621679481439"><span class="annot"><span class="annottext">r -&gt; (a -&gt; b)
</span><a href="#local-6989586621679481439"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481438"><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679481438"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679481437"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481437"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">r -&gt; (a -&gt; b)
</span><a href="#local-6989586621679481439"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481437"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679481438"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481437"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1009"></span><span>    </span><span id="local-6989586621679481436"><span class="annot"><span class="annottext">liftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; (r -&gt; a) -&gt; (r -&gt; b) -&gt; r -&gt; c
</span><a href="#local-6989586621679481436"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span id="local-6989586621679481435"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481435"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679481434"><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679481434"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481433"><span class="annot"><span class="annottext">r -&gt; b
</span><a href="#local-6989586621679481433"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679481432"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481432"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481435"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679481434"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481432"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; b
</span><a href="#local-6989586621679481433"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481432"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1010"></span><span>
</span><span id="line-1011"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1012"></span><span id="local-6989586621679482567"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481425"><span id="local-6989586621679481427"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">-&gt;</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482567"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1013"></span><span>    </span><span id="local-6989586621679481424"><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679481424"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481423"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. (r -&gt; a) -&gt; (a -&gt; r -&gt; b) -&gt; r -&gt; b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481422"><span class="annot"><span class="annottext">a -&gt; r -&gt; b
</span><a href="#local-6989586621679481422"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679481421"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481421"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; r -&gt; b
</span><a href="#local-6989586621679481422"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; a
</span><a href="#local-6989586621679481424"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481421"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679481421"><span class="hs-identifier hs-var">r</span></a></span></span><span>
</span><span id="line-1014"></span><span>
</span><span id="line-1015"></span><span class="hs-comment">-- | @since 4.15</span><span>
</span><span id="line-1016"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1017"></span><span>  </span><span id="local-6989586621679481418"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Solo a -&gt; Solo b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679481417"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481417"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span id="local-6989586621679481416"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481416"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Solo b
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481417"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481416"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1018"></span><span>
</span><span id="line-1019"></span><span>  </span><span class="hs-comment">-- Being strict in the `Solo` argument here seems most consistent</span><span>
</span><span id="line-1020"></span><span>  </span><span class="hs-comment">-- with the concept behind `Solo`: always strict in the wrapper and lazy</span><span>
</span><span id="line-1021"></span><span>  </span><span class="hs-comment">-- in the contents.</span><span>
</span><span id="line-1022"></span><span>  </span><span id="local-6989586621679481415"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481415"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679481414"><span class="annot"><span class="annottext">&lt;$ :: forall a b. a -&gt; Solo b -&gt; Solo a
</span><a href="#local-6989586621679481414"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;$</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-type">Solo</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Solo a
forall a. a -&gt; Solo a
</span><a href="../../ghc-prim/src/GHC.Tuple.html#Solo"><span class="hs-identifier hs-var">Solo</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481415"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1023"></span><span>
</span><span id="line-1024"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1025"></span><span id="local-6989586621679482751"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481411"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679482751"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1026"></span><span>    </span><span id="local-6989586621679481410"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; (a, a) -&gt; (a, b)
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679481409"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481409"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481408"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481408"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679481407"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481407"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481408"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481409"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481407"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1027"></span><span>
</span><span id="line-1028"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1029"></span><span class="hs-keyword">instance</span><span>  </span><span id="local-6989586621679481404"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1030"></span><span>    </span><span id="local-6989586621679481403"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Maybe a -&gt; Maybe b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe b
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1031"></span><span>    </span><span class="annot"><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679481402"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481402"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481401"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481401"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Maybe b
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481402"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481401"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1032"></span><span>
</span><span id="line-1033"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1034"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481393"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1035"></span><span>    </span><span id="local-6989586621679481392"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; Maybe a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe a
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span>
</span><span id="line-1036"></span><span>
</span><span id="line-1037"></span><span>    </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481390"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481390"><span class="hs-identifier hs-var">f</span></a></span></span><span>  </span><span id="local-6989586621679481389"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. Maybe (a -&gt; b) -&gt; Maybe a -&gt; Maybe b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span id="local-6989586621679481388"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481388"><span class="hs-identifier hs-var">m</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Maybe a -&gt; Maybe b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481390"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481388"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1038"></span><span>    </span><span class="annot"><span class="annottext">Maybe (a -&gt; b)
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span id="local-6989586621679481387"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481387"><span class="hs-identifier hs-var">_m</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe b
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1039"></span><span>
</span><span id="line-1040"></span><span>    </span><span id="local-6989586621679481386"><span class="annot"><span class="annottext">liftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; Maybe a -&gt; Maybe b -&gt; Maybe c
</span><a href="#local-6989586621679481386"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span id="local-6989586621679481385"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481385"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481384"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481384"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481383"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481383"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">c -&gt; Maybe c
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481385"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481384"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481383"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1041"></span><span>    </span><span class="annot"><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe c
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1042"></span><span>
</span><span id="line-1043"></span><span>    </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481382"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481382"><span class="hs-identifier hs-var">_m1</span></a></span></span><span> </span><span id="local-6989586621679481381"><span class="annot"><span class="annottext">*&gt; :: forall a b. Maybe a -&gt; Maybe b -&gt; Maybe b
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">*&gt;</span></a></span></span><span> </span><span id="local-6989586621679481380"><span class="annot"><span class="annottext">Maybe b
</span><a href="#local-6989586621679481380"><span class="hs-identifier hs-var">m2</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe b
</span><a href="#local-6989586621679481380"><span class="hs-identifier hs-var">m2</span></a></span><span>
</span><span id="line-1044"></span><span>    </span><span class="annot"><span class="annottext">Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="annot"><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var">*&gt;</span></a></span><span> </span><span id="local-6989586621679481379"><span class="annot"><span class="annottext">Maybe b
</span><a href="#local-6989586621679481379"><span class="hs-identifier hs-var">_m2</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe b
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1045"></span><span>
</span><span id="line-1046"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1047"></span><span class="hs-keyword">instance</span><span>  </span><span id="local-6989586621679481373"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1048"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679481372"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481372"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481371"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. Maybe a -&gt; (a -&gt; Maybe b) -&gt; Maybe b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481370"><span class="annot"><span class="annottext">a -&gt; Maybe b
</span><a href="#local-6989586621679481370"><span class="hs-identifier hs-var">k</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe b
</span><a href="#local-6989586621679481370"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481372"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1049"></span><span>    </span><span class="annot"><span class="annottext">Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe b
</span><span class="hs-identifier">_</span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe b
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1050"></span><span>
</span><span id="line-1051"></span><span>    </span><span id="local-6989586621679481368"><span class="annot"><span class="annottext">&gt;&gt; :: forall a b. Maybe a -&gt; Maybe b -&gt; Maybe b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&gt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a -&gt; Maybe b -&gt; Maybe b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f b -&gt; f b
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var">(*&gt;)</span></a></span><span>
</span><span id="line-1052"></span><span>
</span><span id="line-1053"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1054"></span><span class="hs-comment">-- The Alternative class definition</span><span>
</span><span id="line-1055"></span><span>
</span><span id="line-1056"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">3</span><span> </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-type">&lt;|&gt;</span></a></span><span>
</span><span id="line-1057"></span><span>
</span><span id="line-1058"></span><span class="hs-comment">-- | A monoid on applicative functors.</span><span>
</span><span id="line-1059"></span><span class="hs-comment">--</span><span>
</span><span id="line-1060"></span><span class="hs-comment">-- If defined, 'some' and 'many' should be the least solutions</span><span>
</span><span id="line-1061"></span><span class="hs-comment">-- of the equations:</span><span>
</span><span id="line-1062"></span><span class="hs-comment">--</span><span>
</span><span id="line-1063"></span><span class="hs-comment">-- * @'some' v = (:) 'Prelude.&lt;$&gt;' v '&lt;*&gt;' 'many' v@</span><span>
</span><span id="line-1064"></span><span class="hs-comment">--</span><span>
</span><span id="line-1065"></span><span class="hs-comment">-- * @'many' v = 'some' v '&lt;|&gt;' 'pure' []@</span><span>
</span><span id="line-1066"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Alternative"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-var">Alternative</span></a></span></span><span> </span><span id="local-6989586621679482544"><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1067"></span><span>    </span><span class="hs-comment">-- | The identity of '&lt;|&gt;'</span><span>
</span><span id="line-1068"></span><span>    </span><span id="local-6989586621679482539"><span id="empty"><span class="annot"><a href="GHC.Base.html#empty"><span class="hs-identifier hs-type">empty</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482539"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1069"></span><span>    </span><span class="hs-comment">-- | An associative binary operation</span><span>
</span><span id="line-1070"></span><span>    </span><span id="local-6989586621679482541"><span id="%3C%7C%3E"><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-type">(&lt;|&gt;)</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482541"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482541"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482541"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1071"></span><span>
</span><span id="line-1072"></span><span>    </span><span class="hs-comment">-- | One or more.</span><span>
</span><span id="line-1073"></span><span>    </span><span id="local-6989586621679482543"><span id="some"><span class="annot"><a href="GHC.Base.html#some"><span class="hs-identifier hs-type">some</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482543"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482543"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1074"></span><span>    </span><span id="local-6989586621679481362"><span class="annot"><a href="GHC.Base.html#some"><span class="hs-identifier hs-var hs-var">some</span></a></span><span> </span><span id="local-6989586621679481360"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481360"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f [a]
</span><a href="#local-6989586621679481359"><span class="hs-identifier hs-var">some_v</span></a></span><span>
</span><span id="line-1075"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-1076"></span><span>        </span><span id="local-6989586621679481355"><span class="annot"><span class="annottext">many_v :: f [a]
</span><a href="#local-6989586621679481355"><span class="hs-identifier hs-var hs-var">many_v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f [a]
</span><a href="#local-6989586621679481359"><span class="hs-identifier hs-var">some_v</span></a></span><span> </span><span class="annot"><span class="annottext">f [a] -&gt; f [a] -&gt; f [a]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; f [a]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1077"></span><span>        </span><span id="local-6989586621679481359"><span class="annot"><span class="annottext">some_v :: f [a]
</span><a href="#local-6989586621679481359"><span class="hs-identifier hs-var hs-var">some_v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; f a -&gt; f [a] -&gt; f [a]
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481360"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">f [a]
</span><a href="#local-6989586621679481355"><span class="hs-identifier hs-var">many_v</span></a></span></span><span>
</span><span id="line-1078"></span><span>
</span><span id="line-1079"></span><span>    </span><span class="hs-comment">-- | Zero or more.</span><span>
</span><span id="line-1080"></span><span>    </span><span id="local-6989586621679481354"><span id="many"><span class="annot"><a href="GHC.Base.html#many"><span class="hs-identifier hs-type">many</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481354"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482544"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679481354"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1081"></span><span>    </span><span id="local-6989586621679481352"><span class="annot"><a href="GHC.Base.html#many"><span class="hs-identifier hs-var hs-var">many</span></a></span><span> </span><span id="local-6989586621679481350"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481350"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f [a]
</span><a href="#local-6989586621679481349"><span class="hs-identifier hs-var">many_v</span></a></span><span>
</span><span id="line-1082"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-1083"></span><span>        </span><span id="local-6989586621679481349"><span class="annot"><span class="annottext">many_v :: f [a]
</span><a href="#local-6989586621679481349"><span class="hs-identifier hs-var hs-var">many_v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f [a]
</span><a href="#local-6989586621679481345"><span class="hs-identifier hs-var">some_v</span></a></span><span> </span><span class="annot"><span class="annottext">f [a] -&gt; f [a] -&gt; f [a]
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; f [a]
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1084"></span><span>        </span><span id="local-6989586621679481345"><span class="annot"><span class="annottext">some_v :: f [a]
</span><a href="#local-6989586621679481345"><span class="hs-identifier hs-var hs-var">some_v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; f a -&gt; f [a] -&gt; f [a]
forall (f :: * -&gt; *) a b c.
Applicative f =&gt;
(a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
</span><a href="GHC.Base.html#liftA2"><span class="hs-identifier hs-var">liftA2</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679481350"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">f [a]
</span><a href="#local-6989586621679481349"><span class="hs-identifier hs-var">many_v</span></a></span></span><span>
</span><span id="line-1085"></span><span>
</span><span id="line-1086"></span><span>
</span><span id="line-1087"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1088"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481337"><span id="local-6989586621679481339"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1089"></span><span>    </span><span id="local-6989586621679481335"><span class="annot"><span class="annottext">empty :: forall a. Maybe a
</span><a href="#local-6989586621679481335"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1090"></span><span>    </span><span class="annot"><span class="annottext">Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621679481334"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. Maybe a -&gt; Maybe a -&gt; Maybe a
</span><a href="#local-6989586621679481334"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span id="local-6989586621679481333"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481333"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481333"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1091"></span><span>    </span><span id="local-6989586621679481332"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481332"><span class="hs-identifier hs-var">l</span></a></span></span><span>       </span><span class="annot"><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679481332"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-1092"></span><span>
</span><span id="line-1093"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-1094"></span><span class="hs-comment">-- The MonadPlus class definition</span><span>
</span><span id="line-1095"></span><span>
</span><span id="line-1096"></span><span class="hs-comment">-- | Monads that also support choice and failure.</span><span>
</span><span id="line-1097"></span><span class="hs-keyword">class</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482536"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482536"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="MonadPlus"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-var">MonadPlus</span></a></span></span><span> </span><span id="local-6989586621679482536"><span class="annot"><a href="#local-6989586621679482536"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1098"></span><span>   </span><span class="hs-comment">-- | The identity of 'mplus'.  It should also satisfy the equations</span><span>
</span><span id="line-1099"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-1100"></span><span>   </span><span class="hs-comment">-- &gt; mzero &gt;&gt;= f  =  mzero</span><span>
</span><span id="line-1101"></span><span>   </span><span class="hs-comment">-- &gt; v &gt;&gt; mzero   =  mzero</span><span>
</span><span id="line-1102"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-1103"></span><span>   </span><span class="hs-comment">-- The default definition is</span><span>
</span><span id="line-1104"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-1105"></span><span>   </span><span class="hs-comment">-- @</span><span>
</span><span id="line-1106"></span><span>   </span><span class="hs-comment">-- mzero = 'empty'</span><span>
</span><span id="line-1107"></span><span>   </span><span class="hs-comment">-- @</span><span>
</span><span id="line-1108"></span><span>   </span><span id="local-6989586621679482535"><span id="mzero"><span class="annot"><a href="GHC.Base.html#mzero"><span class="hs-identifier hs-type">mzero</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482536"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482535"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1109"></span><span>   </span><span id="local-6989586621679481327"><span class="annot"><a href="GHC.Base.html#mzero"><span class="hs-identifier hs-var hs-var">mzero</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a
</span><a href="GHC.Base.html#empty"><span class="hs-identifier hs-var">empty</span></a></span></span><span>
</span><span id="line-1110"></span><span>
</span><span id="line-1111"></span><span>   </span><span class="hs-comment">-- | An associative operation. The default definition is</span><span>
</span><span id="line-1112"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-1113"></span><span>   </span><span class="hs-comment">-- @</span><span>
</span><span id="line-1114"></span><span>   </span><span class="hs-comment">-- mplus = ('&lt;|&gt;')</span><span>
</span><span id="line-1115"></span><span>   </span><span class="hs-comment">-- @</span><span>
</span><span id="line-1116"></span><span>   </span><span id="local-6989586621679482533"><span id="mplus"><span class="annot"><a href="GHC.Base.html#mplus"><span class="hs-identifier hs-type">mplus</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482536"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482533"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482536"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482533"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482536"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482533"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1117"></span><span>   </span><span id="local-6989586621679481323"><span class="annot"><a href="GHC.Base.html#mplus"><span class="hs-identifier hs-var hs-var">mplus</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a -&gt; m a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">(&lt;|&gt;)</span></a></span></span><span>
</span><span id="line-1118"></span><span>
</span><span id="line-1119"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1120"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481313"><span id="local-6989586621679481315"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span></span></span><span>
</span><span id="line-1121"></span><span>
</span><span id="line-1122"></span><span class="hs-comment">---------------------------------------------</span><span>
</span><span id="line-1123"></span><span class="hs-comment">-- The non-empty list type</span><span>
</span><span id="line-1124"></span><span>
</span><span id="line-1125"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span>
</span><span id="line-1126"></span><span>
</span><span id="line-1127"></span><span class="hs-comment">-- | Non-empty (and non-strict) list type.</span><span>
</span><span id="line-1128"></span><span class="hs-comment">--</span><span>
</span><span id="line-1129"></span><span class="hs-comment">-- @since 4.9.0.0</span><span>
</span><span id="line-1130"></span><span class="hs-keyword">data</span><span> </span><span id="NonEmpty"><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-var">NonEmpty</span></a></span></span><span> </span><span id="local-6989586621679482820"><span class="annot"><a href="#local-6989586621679482820"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621679482820"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span id="%3A%7C"><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482820"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1131"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621679481305"><span id="local-6989586621679481310"><span class="annot"><span class="annottext">NonEmpty a -&gt; NonEmpty a -&gt; Bool
(NonEmpty a -&gt; NonEmpty a -&gt; Bool)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; Bool) -&gt; Eq (NonEmpty a)
forall a. Eq a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: NonEmpty a -&gt; NonEmpty a -&gt; Bool
$c/= :: forall a. Eq a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
== :: NonEmpty a -&gt; NonEmpty a -&gt; Bool
$c== :: forall a. Eq a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span>  </span><span class="hs-comment">-- ^ @since 4.9.0.0</span><span>
</span><span id="line-1132"></span><span>           </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481280"><span id="local-6989586621679481282"><span id="local-6989586621679481285"><span id="local-6989586621679481288"><span id="local-6989586621679481291"><span id="local-6989586621679481295"><span id="local-6989586621679481300"><span class="annot"><span class="annottext">Eq (NonEmpty a)
Eq (NonEmpty a)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; Ordering)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; Bool)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; Bool)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; Bool)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; Bool)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a)
-&gt; (NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a)
-&gt; Ord (NonEmpty a)
NonEmpty a -&gt; NonEmpty a -&gt; Bool
NonEmpty a -&gt; NonEmpty a -&gt; Ordering
NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
forall {a}. Ord a =&gt; Eq (NonEmpty a)
forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Ordering
forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a
min :: NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a
$cmin :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a
max :: NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a
$cmax :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; NonEmpty a
&gt;= :: NonEmpty a -&gt; NonEmpty a -&gt; Bool
$c&gt;= :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
&gt; :: NonEmpty a -&gt; NonEmpty a -&gt; Bool
$c&gt; :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
&lt;= :: NonEmpty a -&gt; NonEmpty a -&gt; Bool
$c&lt;= :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
&lt; :: NonEmpty a -&gt; NonEmpty a -&gt; Bool
$c&lt; :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Bool
compare :: NonEmpty a -&gt; NonEmpty a -&gt; Ordering
$ccompare :: forall a. Ord a =&gt; NonEmpty a -&gt; NonEmpty a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></a></span></span></span></span></span></span></span></span><span> </span><span class="hs-comment">-- ^ @since 4.9.0.0</span><span>
</span><span id="line-1133"></span><span>           </span><span class="hs-special">)</span><span>
</span><span id="line-1134"></span><span>
</span><span id="line-1135"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-1136"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1137"></span><span>  </span><span id="local-6989586621679481274"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679481273"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481273"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679481272"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481272"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679481271"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481271"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481273"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481272"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; NonEmpty b
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; [a] -&gt; [b]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481273"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481271"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-1138"></span><span>  </span><span id="local-6989586621679481269"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481269"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679481268"><span class="annot"><span class="annottext">&lt;$ :: forall a b. a -&gt; NonEmpty b -&gt; NonEmpty a
</span><a href="#local-6989586621679481268"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;$</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679481267"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481267"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481269"><span class="hs-identifier hs-var">b</span></a></span><span>   </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481269"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [b] -&gt; [a]
forall (f :: * -&gt; *) a b. Functor f =&gt; a -&gt; f b -&gt; f a
</span><a href="GHC.Base.html#%3C%24"><span class="hs-operator hs-var">&lt;$</span></a></span><span> </span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481267"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1139"></span><span>
</span><span id="line-1140"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-1141"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481258"><span id="local-6989586621679481260"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1142"></span><span>  </span><span id="local-6989586621679481257"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; NonEmpty a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679481256"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481256"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481256"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; NonEmpty a
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1143"></span><span>  </span><span id="local-6989586621679481254"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. NonEmpty (a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonEmpty (a -&gt; b) -&gt; NonEmpty a -&gt; NonEmpty b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span>
</span><span id="line-1144"></span><span>  </span><span id="local-6989586621679481252"><span class="annot"><span class="annottext">liftA2 :: forall a b c.
(a -&gt; b -&gt; c) -&gt; NonEmpty a -&gt; NonEmpty b -&gt; NonEmpty c
</span><a href="#local-6989586621679481252"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; c) -&gt; NonEmpty a -&gt; NonEmpty b -&gt; NonEmpty c
forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-var">liftM2</span></a></span><span>
</span><span id="line-1145"></span><span>
</span><span id="line-1146"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-1147"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481245"><span id="local-6989586621679481247"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1148"></span><span>  </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679481244"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481244"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679481243"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481243"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481242"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. NonEmpty a -&gt; (a -&gt; NonEmpty b) -&gt; NonEmpty b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481241"><span class="annot"><span class="annottext">a -&gt; NonEmpty b
</span><a href="#local-6989586621679481241"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481240"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; NonEmpty b
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481239"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">[b] -&gt; [b] -&gt; [b]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481238"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1149"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679481240"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481240"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679481239"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481239"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; NonEmpty b
</span><a href="#local-6989586621679481241"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481244"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-1150"></span><span>          </span><span id="local-6989586621679481238"><span class="annot"><span class="annottext">bs' :: [b]
</span><a href="#local-6989586621679481238"><span class="hs-identifier hs-var hs-var">bs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481243"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; (a -&gt; [b]) -&gt; [b]
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty b -&gt; [b]
forall {a}. NonEmpty a -&gt; [a]
</span><a href="#local-6989586621679481236"><span class="hs-identifier hs-var">toList</span></a></span><span> </span><span class="annot"><span class="annottext">(NonEmpty b -&gt; [b]) -&gt; (a -&gt; NonEmpty b) -&gt; a -&gt; [b]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; NonEmpty b
</span><a href="#local-6989586621679481241"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-1151"></span><span>          </span><span id="local-6989586621679481236"><span class="annot"><span class="annottext">toList :: NonEmpty a -&gt; [a]
</span><a href="#local-6989586621679481236"><span class="hs-identifier hs-var hs-var">toList</span></a></span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span id="local-6989586621679481235"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481235"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span id="local-6989586621679481234"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481234"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481235"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481234"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-1152"></span><span>
</span><span id="line-1153"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1154"></span><span class="hs-comment">-- The list type</span><span>
</span><span id="line-1155"></span><span>
</span><span id="line-1156"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1157"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481231"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1158"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#fmap"><span class="hs-pragma hs-type">fmap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1159"></span><span>    </span><span id="local-6989586621679481230"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; [a] -&gt; [b]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span>
</span><span id="line-1160"></span><span>
</span><span id="line-1161"></span><span class="hs-comment">-- See Note: [List comprehensions and inlining]</span><span>
</span><span id="line-1162"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1163"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481222"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1164"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1165"></span><span>    </span><span id="local-6989586621679481221"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; [a]
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679481220"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481220"><span class="hs-identifier hs-var">x</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481220"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1166"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1167"></span><span>    </span><span id="local-6989586621679481219"><span class="annot"><span class="annottext">[a -&gt; b]
</span><a href="#local-6989586621679481219"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span id="local-6989586621679481218"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. [a -&gt; b] -&gt; [a] -&gt; [b]
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span id="local-6989586621679481217"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481217"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481216"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481215"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679481216"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481216"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[a -&gt; b]
</span><a href="#local-6989586621679481219"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481215"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481215"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481217"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1168"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA2"><span class="hs-pragma hs-type">liftA2</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1169"></span><span>    </span><span id="local-6989586621679481214"><span class="annot"><span class="annottext">liftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="#local-6989586621679481214"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span id="local-6989586621679481213"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481213"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481212"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481212"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679481211"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481211"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481213"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481210"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481209"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679481210"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481210"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481212"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481209"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481209"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481211"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1170"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1171"></span><span>    </span><span id="local-6989586621679481208"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481208"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679481207"><span class="annot"><span class="annottext">*&gt; :: forall a b. [a] -&gt; [b] -&gt; [b]
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">*&gt;</span></a></span></span><span> </span><span id="local-6989586621679481206"><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481206"><span class="hs-identifier hs-var">ys</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481205"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481208"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481205"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481205"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[b]
</span><a href="#local-6989586621679481206"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1172"></span><span>
</span><span id="line-1173"></span><span class="hs-comment">-- See Note: [List comprehensions and inlining]</span><span>
</span><span id="line-1174"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1175"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481199"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1176"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;=</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1177"></span><span>    </span><span id="local-6989586621679481198"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481198"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679481197"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. [a] -&gt; (a -&gt; [b]) -&gt; [b]
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679481196"><span class="annot"><span class="annottext">a -&gt; [b]
</span><a href="#local-6989586621679481196"><span class="hs-identifier hs-var">f</span></a></span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481195"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679481194"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481194"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481198"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481195"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481195"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; [b]
</span><a href="#local-6989586621679481196"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481194"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1178"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1179"></span><span>    </span><span id="local-6989586621679481192"><span class="annot"><span class="annottext">&gt;&gt; :: forall a b. [a] -&gt; [b] -&gt; [b]
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&gt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [b] -&gt; [b]
forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f b -&gt; f b
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var">(*&gt;)</span></a></span><span>
</span><span id="line-1180"></span><span>
</span><span id="line-1181"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1182"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481184"><span id="local-6989586621679481186"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1183"></span><span>    </span><span id="local-6989586621679481183"><span class="annot"><span class="annottext">empty :: forall a. [a]
</span><a href="#local-6989586621679481183"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1184"></span><span>    </span><span id="local-6989586621679481182"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="#local-6989586621679481182"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;|&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">(++)</span></a></span><span>
</span><span id="line-1185"></span><span>
</span><span id="line-1186"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1187"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481174"><span id="local-6989586621679481176"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span></span></span><span>
</span><span id="line-1188"></span><span>
</span><span id="line-1189"></span><span class="hs-comment">{-
A few list functions that appear here because they are used here.
The rest of the prelude list functions are in GHC.List.
-}</span><span>
</span><span id="line-1193"></span><span>
</span><span id="line-1194"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1195"></span><span class="hs-comment">--      foldr/build/augment</span><span>
</span><span id="line-1196"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1197"></span><span>
</span><span id="line-1198"></span><span class="hs-comment">-- | 'foldr', applied to a binary operator, a starting value (typically</span><span>
</span><span id="line-1199"></span><span class="hs-comment">-- the right-identity of the operator), and a list, reduces the list</span><span>
</span><span id="line-1200"></span><span class="hs-comment">-- using the binary operator, from right to left:</span><span>
</span><span id="line-1201"></span><span class="hs-comment">--</span><span>
</span><span id="line-1202"></span><span class="hs-comment">-- &gt; foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)</span><span>
</span><span id="line-1203"></span><span>
</span><span id="line-1204"></span><span id="local-6989586621679482827"><span id="local-6989586621679482828"><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-type">foldr</span></a></span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482828"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482827"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482827"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482827"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482828"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482827"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-1205"></span><span class="hs-comment">-- foldr _ z []     =  z</span><span>
</span><span id="line-1206"></span><span class="hs-comment">-- foldr f z (x:xs) =  f x (foldr f z xs)</span><span>
</span><span id="line-1207"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1208"></span><span class="hs-comment">-- Inline only in the final stage, after the foldr/cons rule has had a chance</span><span>
</span><span id="line-1209"></span><span class="hs-comment">-- Also note that we inline it when it has *two* parameters, which are the</span><span>
</span><span id="line-1210"></span><span class="hs-comment">-- ones we are keen about specialising!</span><span>
</span><span id="line-1211"></span><span id="foldr"><span class="annot"><span class="annottext">foldr :: forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; [a] -&gt; b
</span><a href="GHC.Base.html#foldr"><span class="hs-identifier hs-var hs-var">foldr</span></a></span></span><span> </span><span id="local-6989586621679481173"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679481173"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679481172"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481172"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; b
</span><a href="#local-6989586621679481171"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-1212"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-1213"></span><span>            </span><span id="local-6989586621679481171"><span class="annot"><span class="annottext">go :: [a] -&gt; b
</span><a href="#local-6989586621679481171"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481172"><span class="hs-identifier hs-var">z</span></a></span><span>
</span><span id="line-1214"></span><span>            </span><span class="annot"><a href="#local-6989586621679481171"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481170"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481170"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679481169"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481169"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481170"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679481173"><span class="hs-operator hs-var">`k`</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; b
</span><a href="#local-6989586621679481171"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481169"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1215"></span><span>
</span><span id="line-1216"></span><span class="hs-comment">-- | A list producer that can be fused with 'foldr'.</span><span>
</span><span id="line-1217"></span><span class="hs-comment">-- This function is merely</span><span>
</span><span id="line-1218"></span><span class="hs-comment">--</span><span>
</span><span id="line-1219"></span><span class="hs-comment">-- &gt;    build g = g (:) []</span><span>
</span><span id="line-1220"></span><span class="hs-comment">--</span><span>
</span><span id="line-1221"></span><span class="hs-comment">-- but GHC's simplifier will transform an expression of the form</span><span>
</span><span id="line-1222"></span><span class="hs-comment">-- @'foldr' k z ('build' g)@, which may arise after inlining, to @g k z@,</span><span>
</span><span id="line-1223"></span><span class="hs-comment">-- which avoids producing an intermediate list.</span><span>
</span><span id="line-1224"></span><span>
</span><span id="line-1225"></span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-identifier hs-type">build</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679482496"><span class="annot"><a href="#local-6989586621679482496"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679482495"><span class="annot"><a href="#local-6989586621679482495"><span class="hs-identifier hs-type">b</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482496"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482495"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482495"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482495"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482495"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482496"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1226"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1227"></span><span>        </span><span class="hs-comment">-- The INLINE is important, even though build is tiny,</span><span>
</span><span id="line-1228"></span><span>        </span><span class="hs-comment">-- because it prevents [] getting inlined in the version that</span><span>
</span><span id="line-1229"></span><span>        </span><span class="hs-comment">-- appears in the interface file.  If [] *is* inlined, it</span><span>
</span><span id="line-1230"></span><span>        </span><span class="hs-comment">-- won't match with [] appearing in rules in an importing module.</span><span>
</span><span id="line-1231"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-1232"></span><span>        </span><span class="hs-comment">-- The &quot;1&quot; says to inline in phase 1</span><span>
</span><span id="line-1233"></span><span>
</span><span id="line-1234"></span><span id="build"><span class="annot"><span class="annottext">build :: forall a. (forall b. (a -&gt; b -&gt; b) -&gt; b -&gt; b) -&gt; [a]
</span><a href="GHC.Base.html#build"><span class="hs-identifier hs-var hs-var">build</span></a></span></span><span> </span><span id="local-6989586621679481168"><span class="annot"><span class="annottext">forall b. (a -&gt; b -&gt; b) -&gt; b -&gt; b
</span><a href="#local-6989586621679481168"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; [a] -&gt; [a]
forall b. (a -&gt; b -&gt; b) -&gt; b -&gt; b
</span><a href="#local-6989586621679481168"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1235"></span><span>
</span><span id="line-1236"></span><span class="hs-comment">-- | A list producer that can be fused with 'foldr'.</span><span>
</span><span id="line-1237"></span><span class="hs-comment">-- This function is merely</span><span>
</span><span id="line-1238"></span><span class="hs-comment">--</span><span>
</span><span id="line-1239"></span><span class="hs-comment">-- &gt;    augment g xs = g (:) xs</span><span>
</span><span id="line-1240"></span><span class="hs-comment">--</span><span>
</span><span id="line-1241"></span><span class="hs-comment">-- but GHC's simplifier will transform an expression of the form</span><span>
</span><span id="line-1242"></span><span class="hs-comment">-- @'foldr' k z ('augment' g xs)@, which may arise after inlining, to</span><span>
</span><span id="line-1243"></span><span class="hs-comment">-- @g k ('foldr' k z xs)@, which avoids producing an intermediate list.</span><span>
</span><span id="line-1244"></span><span>
</span><span id="line-1245"></span><span class="annot"><a href="GHC.Base.html#augment"><span class="hs-identifier hs-type">augment</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679482493"><span class="annot"><a href="#local-6989586621679482493"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679482492"><span class="annot"><a href="#local-6989586621679482492"><span class="hs-identifier hs-type">b</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482493"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621679482492"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-glyph">-&gt;</span><span class="annot"><a href="#local-6989586621679482492"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482492"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482492"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482493"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679482493"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1246"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Base.html#augment"><span class="hs-pragma hs-type">augment</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1247"></span><span id="augment"><span class="annot"><span class="annottext">augment :: forall a. (forall b. (a -&gt; b -&gt; b) -&gt; b -&gt; b) -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#augment"><span class="hs-identifier hs-var hs-var">augment</span></a></span></span><span> </span><span id="local-6989586621679481167"><span class="annot"><span class="annottext">forall b. (a -&gt; b -&gt; b) -&gt; b -&gt; b
</span><a href="#local-6989586621679481167"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679481166"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481166"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; [a] -&gt; [a]) -&gt; [a] -&gt; [a]
forall b. (a -&gt; b -&gt; b) -&gt; b -&gt; b
</span><a href="#local-6989586621679481167"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481166"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1248"></span><span>
</span><span id="line-1249"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1250"></span><span id="local-6989586621679481165"><span class="annot"><span class="hs-pragma">&quot;fold/build&quot;</span></span><span>    </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481164"><span class="annot"><a href="#local-6989586621679481164"><span class="hs-pragma hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679481163"><span class="annot"><a href="#local-6989586621679481163"><span class="hs-pragma hs-var">z</span></a></span></span><span> </span><span class="hs-pragma">(</span><span id="local-6989586621679481162"><span class="annot"><a href="#local-6989586621679481162"><span class="hs-pragma hs-var">g</span></a></span></span><span class="hs-pragma">::</span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481161"><span class="annot"><a href="#local-6989586621679481161"><span class="hs-pragma hs-type">b</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481165"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481161"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481161"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481161"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481161"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-1251"></span><span>                </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481164"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481163"><span class="hs-pragma hs-type">z</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481162"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="#local-6989586621679481162"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481164"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481163"><span class="hs-pragma hs-type">z</span></a></span></span><span>
</span><span id="line-1252"></span><span>
</span><span id="line-1253"></span><span id="local-6989586621679481160"><span class="annot"><span class="hs-pragma">&quot;foldr/augment&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481159"><span class="annot"><a href="#local-6989586621679481159"><span class="hs-pragma hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679481158"><span class="annot"><a href="#local-6989586621679481158"><span class="hs-pragma hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679481157"><span class="annot"><a href="#local-6989586621679481157"><span class="hs-pragma hs-var">xs</span></a></span></span><span> </span><span class="hs-pragma">(</span><span id="local-6989586621679481156"><span class="annot"><a href="#local-6989586621679481156"><span class="hs-pragma hs-var">g</span></a></span></span><span class="hs-pragma">::</span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481155"><span class="annot"><a href="#local-6989586621679481155"><span class="hs-pragma hs-type">b</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481160"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481155"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481155"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481155"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481155"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-1254"></span><span>                </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481159"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481158"><span class="hs-pragma hs-type">z</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Base.html#augment"><span class="hs-pragma hs-type">augment</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481156"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481157"><span class="hs-pragma hs-type">xs</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="#local-6989586621679481156"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481159"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481159"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481158"><span class="hs-pragma hs-type">z</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481157"><span class="hs-pragma hs-type">xs</span></a></span><span class="hs-pragma">)</span></span><span>
</span><span id="line-1255"></span><span>
</span><span id="line-1256"></span><span class="annot"><span class="hs-pragma">&quot;foldr/id&quot;</span></span><span>                        </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">:</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="hs-pragma">\</span><span id="local-6989586621679481154"><span class="annot"><a href="#local-6989586621679481154"><span class="hs-pragma hs-var">x</span></a></span></span><span>  </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481154"><span class="hs-pragma hs-type">x</span></a></span><span>
</span><span id="line-1257"></span><span class="annot"><span class="hs-pragma">&quot;foldr/app&quot;</span></span><span>     </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481153"><span class="annot"><a href="#local-6989586621679481153"><span class="hs-pragma hs-var">ys</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">:</span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679481153"><span class="hs-pragma hs-type">ys</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="hs-pragma">\</span><span id="local-6989586621679481152"><span class="annot"><a href="#local-6989586621679481152"><span class="hs-pragma hs-var">xs</span></a></span></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481152"><span class="hs-pragma hs-type">xs</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#%2B%2B"><span class="hs-pragma hs-type">++</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481153"><span class="hs-pragma hs-type">ys</span></a></span><span>
</span><span id="line-1258"></span><span>        </span><span class="hs-pragma">-- Only activate this from phase 1, because that's</span><span>
</span><span id="line-1259"></span><span>        </span><span class="hs-pragma">-- when we disable the rule that expands (++) into foldr</span><span>
</span><span id="line-1260"></span><span>
</span><span id="line-1261"></span><span class="hs-pragma">-- The foldr/cons rule looks nice, but it can give disastrously</span><span>
</span><span id="line-1262"></span><span class="hs-pragma">-- bloated code when commpiling</span><span>
</span><span id="line-1263"></span><span class="hs-pragma">--      array (a,b) [(1,2), (2,2), (3,2), ...very long list... ]</span><span>
</span><span id="line-1264"></span><span class="hs-pragma">-- i.e. when there are very very long literal lists</span><span>
</span><span id="line-1265"></span><span class="hs-pragma">-- So I've disabled it for now. We could have special cases</span><span>
</span><span id="line-1266"></span><span class="hs-pragma">-- for short lists, I suppose.</span><span>
</span><span id="line-1267"></span><span class="hs-pragma">-- &quot;foldr/cons&quot; forall k z x xs. foldr k z (x:xs) = k x (foldr k z xs)</span><span>
</span><span id="line-1268"></span><span>
</span><span id="line-1269"></span><span class="annot"><span class="hs-pragma">&quot;foldr/single&quot;</span></span><span>  </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481151"><span class="annot"><a href="#local-6989586621679481151"><span class="hs-pragma hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679481150"><span class="annot"><a href="#local-6989586621679481150"><span class="hs-pragma hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679481149"><span class="annot"><a href="#local-6989586621679481149"><span class="hs-pragma hs-var">x</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481151"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481150"><span class="hs-pragma hs-type">z</span></a></span><span> </span><span class="hs-pragma">[</span><span class="annot"><a href="#local-6989586621679481149"><span class="hs-pragma hs-type">x</span></a></span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="#local-6989586621679481151"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481149"><span class="hs-pragma hs-type">x</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481150"><span class="hs-pragma hs-type">z</span></a></span><span>
</span><span id="line-1270"></span><span class="annot"><span class="hs-pragma">&quot;foldr/nil&quot;</span></span><span>     </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481148"><span class="annot"><a href="#local-6989586621679481148"><span class="hs-pragma hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679481147"><span class="annot"><a href="#local-6989586621679481147"><span class="hs-pragma hs-var">z</span></a></span></span><span class="hs-pragma">.</span><span>   </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481148"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481147"><span class="hs-pragma hs-type">z</span></a></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span>  </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="#local-6989586621679481147"><span class="hs-pragma hs-type">z</span></a></span><span>
</span><span id="line-1271"></span><span>
</span><span id="line-1272"></span><span id="local-6989586621679481146"><span class="annot"><span class="hs-pragma">&quot;foldr/cons/build&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481145"><span class="annot"><a href="#local-6989586621679481145"><span class="hs-pragma hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679481144"><span class="annot"><a href="#local-6989586621679481144"><span class="hs-pragma hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679481143"><span class="annot"><a href="#local-6989586621679481143"><span class="hs-pragma hs-var">x</span></a></span></span><span> </span><span class="hs-pragma">(</span><span id="local-6989586621679481142"><span class="annot"><a href="#local-6989586621679481142"><span class="hs-pragma hs-var">g</span></a></span></span><span class="hs-pragma">::</span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481141"><span class="annot"><a href="#local-6989586621679481141"><span class="hs-pragma hs-type">b</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481146"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481141"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481141"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481141"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481141"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-1273"></span><span>                           </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481145"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481144"><span class="hs-pragma hs-type">z</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481143"><span class="hs-pragma hs-type">x</span></a></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-pragma hs-type">:</span></a></span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481142"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="#local-6989586621679481145"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481143"><span class="hs-pragma hs-type">x</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481142"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481145"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481144"><span class="hs-pragma hs-type">z</span></a></span><span class="hs-pragma">)</span></span><span>
</span><span id="line-1274"></span><span>
</span><span id="line-1275"></span><span id="local-6989586621679481140"><span class="annot"><span class="hs-pragma">&quot;augment/build&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span class="hs-pragma">(</span><span id="local-6989586621679481139"><span class="annot"><a href="#local-6989586621679481139"><span class="hs-pragma hs-var">g</span></a></span></span><span class="hs-pragma">::</span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481138"><span class="annot"><a href="#local-6989586621679481138"><span class="hs-pragma hs-type">b</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481140"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481138"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481138"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481138"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481138"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-1276"></span><span>                       </span><span class="hs-pragma">(</span><span id="local-6989586621679481137"><span class="annot"><a href="#local-6989586621679481137"><span class="hs-pragma hs-var">h</span></a></span></span><span class="hs-pragma">::</span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481136"><span class="annot"><a href="#local-6989586621679481136"><span class="hs-pragma hs-type">b</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481140"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481136"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481136"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481136"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481136"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-1277"></span><span>                       </span><span class="annot"><a href="GHC.Base.html#augment"><span class="hs-pragma hs-type">augment</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481139"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481137"><span class="hs-pragma hs-type">h</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">\</span><span id="local-6989586621679481135"><span class="annot"><a href="#local-6989586621679481135"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679481134"><span class="annot"><a href="#local-6989586621679481134"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481139"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481135"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481137"><span class="hs-pragma hs-type">h</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481135"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481134"><span class="hs-pragma hs-type">n</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span></span><span>
</span><span id="line-1278"></span><span id="local-6989586621679481133"><span class="annot"><span class="hs-pragma">&quot;augment/nil&quot;</span></span><span>   </span><span class="hs-pragma">forall</span><span> </span><span class="hs-pragma">(</span><span id="local-6989586621679481132"><span class="annot"><a href="#local-6989586621679481132"><span class="hs-pragma hs-var">g</span></a></span></span><span class="hs-pragma">::</span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481131"><span class="annot"><a href="#local-6989586621679481131"><span class="hs-pragma hs-type">b</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481133"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481131"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">-&gt;</span><span class="annot"><a href="#local-6989586621679481131"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481131"><span class="hs-pragma hs-type">b</span></a></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481131"><span class="hs-pragma hs-type">b</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">.</span><span>
</span><span id="line-1279"></span><span>                        </span><span class="annot"><a href="GHC.Base.html#augment"><span class="hs-pragma hs-type">augment</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481132"><span class="hs-pragma hs-type">g</span></a></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481132"><span class="hs-pragma hs-type">g</span></a></span></span><span>
</span><span id="line-1280"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1281"></span><span>
</span><span id="line-1282"></span><span class="hs-comment">-- This rule is true, but not (I think) useful:</span><span>
</span><span id="line-1283"></span><span class="hs-comment">--      augment g (augment h t) = augment (\cn -&gt; g c (h c n)) t</span><span>
</span><span id="line-1284"></span><span>
</span><span id="line-1285"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1286"></span><span class="hs-comment">--              map</span><span>
</span><span id="line-1287"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1288"></span><span>
</span><span id="line-1289"></span><span class="hs-comment">-- | \(\mathcal{O}(n)\). 'map' @f xs@ is the list obtained by applying @f@ to</span><span>
</span><span id="line-1290"></span><span class="hs-comment">-- each element of @xs@, i.e.,</span><span>
</span><span id="line-1291"></span><span class="hs-comment">--</span><span>
</span><span id="line-1292"></span><span class="hs-comment">-- &gt; map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]</span><span>
</span><span id="line-1293"></span><span class="hs-comment">-- &gt; map f [x1, x2, ...] == [f x1, f x2, ...]</span><span>
</span><span id="line-1294"></span><span class="hs-comment">--</span><span>
</span><span id="line-1295"></span><span class="hs-comment">-- &gt;&gt;&gt; map (+1) [1, 2, 3]</span><span>
</span><span id="line-1296"></span><span class="hs-comment">-- [2,3,4]</span><span>
</span><span id="line-1297"></span><span id="local-6989586621679481129"><span id="local-6989586621679481130"><span class="annot"><a href="GHC.Base.html#map"><span class="hs-identifier hs-type">map</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679481130"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481129"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679481130"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679481129"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-1298"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Base.html#map"><span class="hs-pragma hs-type">map</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1299"></span><span>  </span><span class="hs-comment">-- We want the RULEs &quot;map&quot; and &quot;map/coerce&quot; to fire first.</span><span>
</span><span id="line-1300"></span><span>  </span><span class="hs-comment">-- map is recursive, so won't inline anyway,</span><span>
</span><span id="line-1301"></span><span>  </span><span class="hs-comment">-- but saying so is more explicit, and silences warnings</span><span>
</span><span id="line-1302"></span><span id="map"><span class="annot"><span class="annottext">map :: forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="GHC.Base.html#map"><span class="hs-identifier hs-var hs-var">map</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1303"></span><span class="annot"><a href="GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span id="local-6989586621679481128"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481128"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481127"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481127"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679481126"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481126"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481128"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481127"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; [b] -&gt; [b]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; [a] -&gt; [b]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481128"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481126"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1304"></span><span>
</span><span id="line-1305"></span><span class="hs-comment">-- Note eta expanded</span><span>
</span><span id="line-1306"></span><span id="local-6989586621679482486"><span id="local-6989586621679482487"><span id="local-6989586621679482488"><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-identifier hs-type">mapFB</span></a></span><span> </span><span class="hs-glyph">::</span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482488"><span class="hs-identifier hs-type">elt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482487"><span class="hs-identifier hs-type">lst</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482487"><span class="hs-identifier hs-type">lst</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482486"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482488"><span class="hs-identifier hs-type">elt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482486"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482487"><span class="hs-identifier hs-type">lst</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482487"><span class="hs-identifier hs-type">lst</span></a></span></span></span></span><span>
</span><span id="line-1307"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-pragma hs-type">mapFB</span></a></span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-comment">-- See Note [Inline FB functions] in GHC.List</span><span>
</span><span id="line-1308"></span><span id="mapFB"><span class="annot"><span class="annottext">mapFB :: forall elt lst a.
(elt -&gt; lst -&gt; lst) -&gt; (a -&gt; elt) -&gt; a -&gt; lst -&gt; lst
</span><a href="GHC.Base.html#mapFB"><span class="hs-identifier hs-var hs-var">mapFB</span></a></span></span><span> </span><span id="local-6989586621679481124"><span class="annot"><span class="annottext">elt -&gt; lst -&gt; lst
</span><a href="#local-6989586621679481124"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679481123"><span class="annot"><span class="annottext">a -&gt; elt
</span><a href="#local-6989586621679481123"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679481122"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481122"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679481121"><span class="annot"><span class="annottext">lst
</span><a href="#local-6989586621679481121"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">elt -&gt; lst -&gt; lst
</span><a href="#local-6989586621679481124"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; elt
</span><a href="#local-6989586621679481123"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481122"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">lst
</span><a href="#local-6989586621679481121"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1309"></span><span>
</span><span id="line-1310"></span><span class="hs-comment">{- Note [The rules for map]
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The rules for map work like this.

* Up to (but not including) phase 1, we use the &quot;map&quot; rule to
  rewrite all saturated applications of map with its build/fold
  form, hoping for fusion to happen.

  In phase 1 and 0, we switch off that rule, inline build, and
  switch on the &quot;mapList&quot; rule, which rewrites the foldr/mapFB
  thing back into plain map.

  It's important that these two rules aren't both active at once
  (along with build's unfolding) else we'd get an infinite loop
  in the rules.  Hence the activation control below.

* This same pattern is followed by many other functions:
  e.g. append, filter, iterate, repeat, etc. in GHC.List

  See also Note [Inline FB functions] in GHC.List

* The &quot;mapFB&quot; rule optimises compositions of map

* The &quot;mapFB/id&quot; rule gets rid of 'map id' calls.
  You might think that (mapFB c id) will turn into c simply
  when mapFB is inlined; but before that happens the &quot;mapList&quot;
  rule turns
     (foldr (mapFB (:) id) [] a
  back into
     map id
  Which is not very clever.

* Any similarity to the Functor laws for [] is expected.
-}</span><span>
</span><span id="line-1344"></span><span>
</span><span id="line-1345"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1346"></span><span class="annot"><span class="hs-pragma">&quot;map&quot;</span></span><span>       </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481120"><span class="annot"><a href="#local-6989586621679481120"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481119"><span class="annot"><a href="#local-6989586621679481119"><span class="hs-pragma hs-var">xs</span></a></span></span><span class="hs-pragma">.</span><span>   </span><span class="annot"><a href="GHC.Base.html#map"><span class="hs-pragma hs-type">map</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481120"><span class="hs-pragma hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481119"><span class="hs-pragma hs-type">xs</span></a></span><span>                </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">\</span><span id="local-6989586621679481118"><span class="annot"><a href="#local-6989586621679481118"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679481117"><span class="annot"><a href="#local-6989586621679481117"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-pragma hs-type">mapFB</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481118"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481120"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679481117"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481119"><span class="hs-pragma hs-type">xs</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-1347"></span><span class="annot"><span class="hs-pragma">&quot;mapList&quot;</span></span><span>   </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span>  </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481116"><span class="annot"><a href="#local-6989586621679481116"><span class="hs-pragma hs-var">f</span></a></span></span><span class="hs-pragma">.</span><span>      </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-pragma hs-type">mapFB</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">:</span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679481116"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span>  </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#map"><span class="hs-pragma hs-type">map</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481116"><span class="hs-pragma hs-type">f</span></a></span><span>
</span><span id="line-1348"></span><span class="annot"><span class="hs-pragma">&quot;mapFB&quot;</span></span><span>     </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481115"><span class="annot"><a href="#local-6989586621679481115"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679481114"><span class="annot"><a href="#local-6989586621679481114"><span class="hs-pragma hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481113"><span class="annot"><a href="#local-6989586621679481113"><span class="hs-pragma hs-var">g</span></a></span></span><span class="hs-pragma">.</span><span>       </span><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-pragma hs-type">mapFB</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-pragma hs-type">mapFB</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481115"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481114"><span class="hs-pragma hs-type">f</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679481113"><span class="hs-pragma hs-type">g</span></a></span><span>     </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-pragma hs-type">mapFB</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481115"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="#local-6989586621679481114"><span class="hs-pragma hs-type">f</span></a></span><span class="annot"><a href="GHC.Base.html#."><span class="hs-pragma hs-type">.</span></a></span><span class="annot"><a href="#local-6989586621679481113"><span class="hs-pragma hs-type">g</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-1349"></span><span class="annot"><span class="hs-pragma">&quot;mapFB/id&quot;</span></span><span>  </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481112"><span class="annot"><a href="#local-6989586621679481112"><span class="hs-pragma hs-var">c</span></a></span></span><span class="hs-pragma">.</span><span>           </span><span class="annot"><a href="GHC.Base.html#mapFB"><span class="hs-pragma hs-type">mapFB</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481112"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">\</span><span id="local-6989586621679481111"><span class="annot"><a href="#local-6989586621679481111"><span class="hs-pragma hs-var">x</span></a></span></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481111"><span class="hs-pragma hs-type">x</span></a></span><span class="hs-pragma">)</span><span>       </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="#local-6989586621679481112"><span class="hs-pragma hs-type">c</span></a></span><span>
</span><span id="line-1350"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1351"></span><span>
</span><span id="line-1352"></span><span class="hs-comment">-- See Breitner, Eisenberg, Peyton Jones, and Weirich, &quot;Safe Zero-cost</span><span>
</span><span id="line-1353"></span><span class="hs-comment">-- Coercions for Haskell&quot;, section 6.5:</span><span>
</span><span id="line-1354"></span><span class="hs-comment">--   http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/coercible.pdf</span><span>
</span><span id="line-1355"></span><span>
</span><span id="line-1356"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;map/coerce&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="GHC.Base.html#map"><span class="hs-pragma hs-type">map</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#coerce"><span class="hs-pragma hs-type">coerce</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#coerce"><span class="hs-pragma hs-type">coerce</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1357"></span><span class="hs-comment">-- See Note [Getting the map/coerce RULE to work] in CoreOpt</span><span>
</span><span id="line-1358"></span><span>
</span><span id="line-1359"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1360"></span><span class="hs-comment">--              append</span><span>
</span><span id="line-1361"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1362"></span><span>
</span><span id="line-1363"></span><span class="hs-comment">-- | Append two lists, i.e.,</span><span>
</span><span id="line-1364"></span><span class="hs-comment">--</span><span>
</span><span id="line-1365"></span><span class="hs-comment">-- &gt; [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]</span><span>
</span><span id="line-1366"></span><span class="hs-comment">-- &gt; [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]</span><span>
</span><span id="line-1367"></span><span class="hs-comment">--</span><span>
</span><span id="line-1368"></span><span class="hs-comment">-- If the first list is not finite, the result is the first list.</span><span>
</span><span id="line-1369"></span><span>
</span><span id="line-1370"></span><span id="local-6989586621679481110"><span class="annot"><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-type">(++)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679481110"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679481110"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679481110"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1371"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">++</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>    </span><span class="hs-comment">-- We want the RULE to fire first.</span><span>
</span><span id="line-1372"></span><span>                             </span><span class="hs-comment">-- It's recursive, so won't inline anyway,</span><span>
</span><span id="line-1373"></span><span>                             </span><span class="hs-comment">-- but saying so is more explicit</span><span>
</span><span id="line-1374"></span><span id="%2B%2B"><span class="annot"><span class="annottext">++ :: forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var hs-var">(++)</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span id="local-6989586621679481109"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481109"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481109"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1375"></span><span class="annot"><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">(++)</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481108"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481108"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679481107"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481107"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481106"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481106"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481108"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481107"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679481106"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1376"></span><span>
</span><span id="line-1377"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1378"></span><span class="annot"><span class="hs-pragma">&quot;++&quot;</span></span><span>    </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679481105"><span class="annot"><a href="#local-6989586621679481105"><span class="hs-pragma hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679481104"><span class="annot"><a href="#local-6989586621679481104"><span class="hs-pragma hs-var">ys</span></a></span></span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="#local-6989586621679481105"><span class="hs-pragma hs-type">xs</span></a></span><span> </span><span class="annot"><a href="GHC.Base.html#%2B%2B"><span class="hs-pragma hs-type">++</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481104"><span class="hs-pragma hs-type">ys</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#augment"><span class="hs-pragma hs-type">augment</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">\</span><span id="local-6989586621679481103"><span class="annot"><a href="#local-6989586621679481103"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679481102"><span class="annot"><a href="#local-6989586621679481102"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span class="hs-pragma">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481103"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481102"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481105"><span class="hs-pragma hs-type">xs</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679481104"><span class="hs-pragma hs-type">ys</span></a></span><span>
</span><span id="line-1379"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1380"></span><span>
</span><span id="line-1381"></span><span>
</span><span id="line-1382"></span><span class="hs-comment">-- |'otherwise' is defined as the value 'True'.  It helps to make</span><span>
</span><span id="line-1383"></span><span class="hs-comment">-- guards more readable.  eg.</span><span>
</span><span id="line-1384"></span><span class="hs-comment">--</span><span>
</span><span id="line-1385"></span><span class="hs-comment">-- &gt;  f x | x &lt; 0     = ...</span><span>
</span><span id="line-1386"></span><span class="hs-comment">-- &gt;      | otherwise = ...</span><span>
</span><span id="line-1387"></span><span class="annot"><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-type">otherwise</span></a></span><span>               </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-1388"></span><span id="otherwise"><span class="annot"><span class="annottext">otherwise :: Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var hs-var">otherwise</span></a></span></span><span>               </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-1389"></span><span>
</span><span id="line-1390"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1391"></span><span class="hs-comment">-- Type Char and String</span><span>
</span><span id="line-1392"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1393"></span><span>
</span><span id="line-1394"></span><span class="hs-comment">-- | A 'String' is a list of characters.  String constants in Haskell are values</span><span>
</span><span id="line-1395"></span><span class="hs-comment">-- of type 'String'.</span><span>
</span><span id="line-1396"></span><span class="hs-comment">--</span><span>
</span><span id="line-1397"></span><span class="hs-comment">-- See &quot;Data.List&quot; for operations on lists.</span><span>
</span><span id="line-1398"></span><span class="hs-keyword">type</span><span> </span><span id="String"><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-var">String</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1399"></span><span>
</span><span id="line-1400"></span><span class="annot"><a href="GHC.Base.html#unsafeChr"><span class="hs-identifier hs-type">unsafeChr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-1401"></span><span id="unsafeChr"><span class="annot"><span class="annottext">unsafeChr :: Int -&gt; Char
</span><a href="GHC.Base.html#unsafeChr"><span class="hs-identifier hs-var hs-var">unsafeChr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679481100"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679481100"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char# -&gt; Char
</span><a href="../../ghc-prim/src/GHC.Types.html#C%23"><span class="hs-identifier hs-var">C#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Char#
</span><a href="../../ghc-prim/src/GHC.Prim.html#chr%23"><span class="hs-identifier hs-var">chr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679481100"><span class="hs-identifier hs-var">i#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1402"></span><span>
</span><span id="line-1403"></span><span class="hs-comment">-- | The 'Prelude.fromEnum' method restricted to the type 'Data.Char.Char'.</span><span>
</span><span id="line-1404"></span><span class="annot"><a href="GHC.Base.html#ord"><span class="hs-identifier hs-type">ord</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-1405"></span><span id="ord"><span class="annot"><span class="annottext">ord :: Char -&gt; Int
</span><a href="GHC.Base.html#ord"><span class="hs-identifier hs-var hs-var">ord</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#C%23"><span class="hs-identifier hs-type">C#</span></a></span><span> </span><span id="local-6989586621679481098"><span class="annot"><span class="annottext">Char#
</span><a href="#local-6989586621679481098"><span class="hs-identifier hs-var">c#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#ord%23"><span class="hs-identifier hs-var">ord#</span></a></span><span> </span><span class="annot"><span class="annottext">Char#
</span><a href="#local-6989586621679481098"><span class="hs-identifier hs-var">c#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1406"></span><span>
</span><span id="line-1407"></span><span class="hs-comment">-- | This 'String' equality predicate is used when desugaring</span><span>
</span><span id="line-1408"></span><span class="hs-comment">-- pattern-matches against strings.</span><span>
</span><span id="line-1409"></span><span class="annot"><a href="GHC.Base.html#eqString"><span class="hs-identifier hs-type">eqString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-1410"></span><span id="eqString"><span class="annot"><span class="annottext">eqString :: String -&gt; String -&gt; Bool
</span><a href="GHC.Base.html#eqString"><span class="hs-identifier hs-var hs-var">eqString</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-1411"></span><span class="annot"><a href="GHC.Base.html#eqString"><span class="hs-identifier hs-var">eqString</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481097"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679481097"><span class="hs-identifier hs-var">c1</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679481096"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679481096"><span class="hs-identifier hs-var">cs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481095"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679481095"><span class="hs-identifier hs-var">c2</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679481094"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679481094"><span class="hs-identifier hs-var">cs2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679481097"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679481095"><span class="hs-identifier hs-var">c2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679481096"><span class="hs-identifier hs-var">cs1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
</span><a href="GHC.Base.html#eqString"><span class="hs-operator hs-var">`eqString`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679481094"><span class="hs-identifier hs-var">cs2</span></a></span><span>
</span><span id="line-1412"></span><span class="annot"><a href="GHC.Base.html#eqString"><span class="hs-identifier hs-var">eqString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>        </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-1413"></span><span>
</span><span id="line-1414"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;eqString&quot;</span></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">==</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#eqString"><span class="hs-pragma hs-type">eqString</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1415"></span><span class="hs-comment">-- eqString also has a BuiltInRule in GHC.Core.Opt.ConstantFold:</span><span>
</span><span id="line-1416"></span><span class="hs-comment">--      eqString (unpackCString# (Lit s1)) (unpackCString# (Lit s2)) = s1==s2</span><span>
</span><span id="line-1417"></span><span>
</span><span id="line-1418"></span><span>
</span><span id="line-1419"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1420"></span><span class="hs-comment">-- 'Int' related definitions</span><span>
</span><span id="line-1421"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1422"></span><span>
</span><span id="line-1423"></span><span class="annot"><a href="GHC.Base.html#maxInt"><span class="hs-identifier hs-type">maxInt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#minInt"><span class="hs-identifier hs-type">minInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-1424"></span><span>
</span><span id="line-1425"></span><span class="hs-comment">{- Seems clumsy. Should perhaps put minInt and MaxInt directly into MachDeps.h -}</span><span class="hs-cpp">
#if WORD_SIZE_IN_BITS == 31
</span><span class="hs-identifier">minInt</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-special">(</span><span class="hs-number">-0x40000000#</span><span class="hs-special">)</span><span>
</span><span id="line-1428"></span><span class="hs-identifier">maxInt</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-number">0x3FFFFFFF#</span><span class="hs-cpp">
#elif WORD_SIZE_IN_BITS == 32
</span><span class="hs-identifier">minInt</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-special">(</span><span class="hs-number">-0x80000000#</span><span class="hs-special">)</span><span>
</span><span id="line-1431"></span><span class="hs-identifier">maxInt</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-number">0x7FFFFFFF#</span><span class="hs-cpp">
#else
</span><span id="minInt"><span class="annot"><span class="annottext">minInt :: Int
</span><a href="GHC.Base.html#minInt"><span class="hs-identifier hs-var hs-var">minInt</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">-0x8000000000000000#</span></span><span class="hs-special">)</span><span>
</span><span id="line-1434"></span><span id="maxInt"><span class="annot"><span class="annottext">maxInt :: Int
</span><a href="GHC.Base.html#maxInt"><span class="hs-identifier hs-var hs-var">maxInt</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0x7FFFFFFFFFFFFFFF#</span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-1437"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1438"></span><span class="hs-comment">-- The function type</span><span>
</span><span id="line-1439"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1440"></span><span>
</span><span id="line-1441"></span><span class="hs-comment">-- | Identity function.</span><span>
</span><span id="line-1442"></span><span class="hs-comment">--</span><span>
</span><span id="line-1443"></span><span class="hs-comment">-- &gt; id x = x</span><span>
</span><span id="line-1444"></span><span id="local-6989586621679482688"><span class="annot"><a href="GHC.Base.html#id"><span class="hs-identifier hs-type">id</span></a></span><span>                      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482688"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482688"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1445"></span><span id="id"><span class="annot"><span class="annottext">id :: forall a. a -&gt; a
</span><a href="GHC.Base.html#id"><span class="hs-identifier hs-var hs-var">id</span></a></span></span><span> </span><span id="local-6989586621679481090"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481090"><span class="hs-identifier hs-var">x</span></a></span></span><span>                    </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481090"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1446"></span><span>
</span><span id="line-1447"></span><span class="hs-comment">-- Assertion function.  This simply ignores its boolean argument.</span><span>
</span><span id="line-1448"></span><span class="hs-comment">-- The compiler may rewrite it to @('assertError' line)@.</span><span>
</span><span id="line-1449"></span><span>
</span><span id="line-1450"></span><span class="hs-comment">-- | If the first argument evaluates to 'True', then the result is the</span><span>
</span><span id="line-1451"></span><span class="hs-comment">-- second argument.  Otherwise an 'Control.Exception.AssertionFailed' exception</span><span>
</span><span id="line-1452"></span><span class="hs-comment">-- is raised, containing a 'String' with the source file and line number of the</span><span>
</span><span id="line-1453"></span><span class="hs-comment">-- call to 'assert'.</span><span>
</span><span id="line-1454"></span><span class="hs-comment">--</span><span>
</span><span id="line-1455"></span><span class="hs-comment">-- Assertions can normally be turned on or off with a compiler flag</span><span>
</span><span id="line-1456"></span><span class="hs-comment">-- (for GHC, assertions are normally on unless optimisation is turned on</span><span>
</span><span id="line-1457"></span><span class="hs-comment">-- with @-O@ or the @-fignore-asserts@</span><span>
</span><span id="line-1458"></span><span class="hs-comment">-- option is given).  When assertions are turned off, the first</span><span>
</span><span id="line-1459"></span><span class="hs-comment">-- argument to 'assert' is ignored, and the second argument is</span><span>
</span><span id="line-1460"></span><span class="hs-comment">-- returned as the result.</span><span>
</span><span id="line-1461"></span><span>
</span><span id="line-1462"></span><span class="hs-comment">--      SLPJ: in 5.04 etc 'assert' is in GHC.Prim,</span><span>
</span><span id="line-1463"></span><span class="hs-comment">--      but from Template Haskell onwards it's simply</span><span>
</span><span id="line-1464"></span><span class="hs-comment">--      defined here in Base.hs</span><span>
</span><span id="line-1465"></span><span id="local-6989586621679482480"><span class="annot"><a href="GHC.Base.html#assert"><span class="hs-identifier hs-type">assert</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482480"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482480"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1466"></span><span id="assert"><span class="annot"><span class="annottext">assert :: forall a. Bool -&gt; a -&gt; a
</span><a href="GHC.Base.html#assert"><span class="hs-identifier hs-var hs-var">assert</span></a></span></span><span> </span><span id="local-6989586621679481089"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679481089"><span class="hs-identifier hs-var">_pred</span></a></span></span><span> </span><span id="local-6989586621679481088"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481088"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481088"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1467"></span><span>
</span><span id="line-1468"></span><span id="local-6989586621679481087"><span class="annot"><a href="GHC.Base.html#breakpoint"><span class="hs-identifier hs-type">breakpoint</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679481087"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481087"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1469"></span><span id="breakpoint"><span class="annot"><span class="annottext">breakpoint :: forall a. a -&gt; a
</span><a href="GHC.Base.html#breakpoint"><span class="hs-identifier hs-var hs-var">breakpoint</span></a></span></span><span> </span><span id="local-6989586621679481086"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481086"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481086"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1470"></span><span>
</span><span id="line-1471"></span><span id="local-6989586621679481085"><span class="annot"><a href="GHC.Base.html#breakpointCond"><span class="hs-identifier hs-type">breakpointCond</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481085"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481085"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1472"></span><span id="breakpointCond"><span class="annot"><span class="annottext">breakpointCond :: forall a. Bool -&gt; a -&gt; a
</span><a href="GHC.Base.html#breakpointCond"><span class="hs-identifier hs-var hs-var">breakpointCond</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679481084"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481084"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481084"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1473"></span><span>
</span><span id="line-1474"></span><span class="hs-keyword">data</span><span> </span><span id="Opaque"><span class="annot"><a href="GHC.Base.html#Opaque"><span class="hs-identifier hs-var">Opaque</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679481083"><span class="annot"><a href="#local-6989586621679481083"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span id="O"><span class="annot"><a href="GHC.Base.html#O"><span class="hs-identifier hs-var">O</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679481083"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-1475"></span><span class="hs-comment">-- | @const x@ is a unary function which evaluates to @x@ for all inputs.</span><span>
</span><span id="line-1476"></span><span class="hs-comment">--</span><span>
</span><span id="line-1477"></span><span class="hs-comment">-- &gt;&gt;&gt; const 42 &quot;hello&quot;</span><span>
</span><span id="line-1478"></span><span class="hs-comment">-- 42</span><span>
</span><span id="line-1479"></span><span class="hs-comment">--</span><span>
</span><span id="line-1480"></span><span class="hs-comment">-- &gt;&gt;&gt; map (const 42) [0..3]</span><span>
</span><span id="line-1481"></span><span class="hs-comment">-- [42,42,42,42]</span><span>
</span><span id="line-1482"></span><span id="local-6989586621679482691"><span id="local-6989586621679482692"><span class="annot"><a href="GHC.Base.html#const"><span class="hs-identifier hs-type">const</span></a></span><span>                   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482692"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482691"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482692"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-1483"></span><span id="const"><span class="annot"><span class="annottext">const :: forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var hs-var">const</span></a></span></span><span> </span><span id="local-6989586621679481081"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481081"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481081"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1484"></span><span>
</span><span id="line-1485"></span><span class="hs-comment">-- | Function composition.</span><span>
</span><span id="line-1486"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">.</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1487"></span><span class="hs-comment">-- Make sure it has TWO args only on the left, so that it inlines</span><span>
</span><span id="line-1488"></span><span class="hs-comment">-- when applied to two functions, even if there is no final argument</span><span>
</span><span id="line-1489"></span><span id="local-6989586621679482693"><span id="local-6989586621679482694"><span id="local-6989586621679482695"><span class="annot"><a href="GHC.Base.html#."><span class="hs-operator hs-type">(.)</span></a></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482695"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482694"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482693"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482695"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482693"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482694"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-1490"></span><span id="."><span class="annot"><span class="annottext">. :: forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var hs-var">(.)</span></a></span></span><span> </span><span id="local-6989586621679481080"><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679481080"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481079"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481079"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679481078"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481078"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; c
</span><a href="#local-6989586621679481080"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481079"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481078"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1491"></span><span>
</span><span id="line-1492"></span><span class="hs-comment">-- | @'flip' f@ takes its (first) two arguments in the reverse order of @f@.</span><span>
</span><span id="line-1493"></span><span class="hs-comment">--</span><span>
</span><span id="line-1494"></span><span class="hs-comment">-- &gt;&gt;&gt; flip (++) &quot;hello&quot; &quot;world&quot;</span><span>
</span><span id="line-1495"></span><span class="hs-comment">-- &quot;worldhello&quot;</span><span>
</span><span id="line-1496"></span><span id="local-6989586621679482469"><span id="local-6989586621679482470"><span id="local-6989586621679482471"><span class="annot"><a href="GHC.Base.html#flip"><span class="hs-identifier hs-type">flip</span></a></span><span>                    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482471"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482470"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482469"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482470"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482471"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482469"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-1497"></span><span id="flip"><span class="annot"><span class="annottext">flip :: forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="GHC.Base.html#flip"><span class="hs-identifier hs-var hs-var">flip</span></a></span></span><span> </span><span id="local-6989586621679481076"><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481076"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481075"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481075"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679481074"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481074"><span class="hs-identifier hs-var">y</span></a></span></span><span>              </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a -&gt; b -&gt; c
</span><a href="#local-6989586621679481076"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481074"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679481075"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1498"></span><span>
</span><span id="line-1499"></span><span class="hs-comment">-- | Application operator.  This operator is redundant, since ordinary</span><span>
</span><span id="line-1500"></span><span class="hs-comment">-- application @(f x)@ means the same as @(f '$' x)@. However, '$' has</span><span>
</span><span id="line-1501"></span><span class="hs-comment">-- low, right-associative binding precedence, so it sometimes allows</span><span>
</span><span id="line-1502"></span><span class="hs-comment">-- parentheses to be omitted; for example:</span><span>
</span><span id="line-1503"></span><span class="hs-comment">--</span><span>
</span><span id="line-1504"></span><span class="hs-comment">-- &gt; f $ g $ h x  =  f (g (h x))</span><span>
</span><span id="line-1505"></span><span class="hs-comment">--</span><span>
</span><span id="line-1506"></span><span class="hs-comment">-- It is also useful in higher-order situations, such as @'map' ('$' 0) xs@,</span><span>
</span><span id="line-1507"></span><span class="hs-comment">-- or @'Data.List.zipWith' ('$') fs xs@.</span><span>
</span><span id="line-1508"></span><span class="hs-comment">--</span><span>
</span><span id="line-1509"></span><span class="hs-comment">-- Note that @('$')@ is levity-polymorphic in its result type, so that</span><span>
</span><span id="line-1510"></span><span class="hs-comment">-- @foo '$' True@ where @foo :: Bool -&gt; Int#@ is well-typed.</span><span>
</span><span id="line-1511"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">$</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1512"></span><span class="annot"><a href="GHC.Base.html#%24"><span class="hs-operator hs-type">($)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679482465"><span class="annot"><a href="#local-6989586621679482465"><span class="hs-identifier hs-type">r</span></a></span></span><span> </span><span id="local-6989586621679482464"><span class="annot"><a href="#local-6989586621679482464"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679482463"><span class="annot"><a href="#local-6989586621679482463"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#TYPE"><span class="hs-identifier hs-type">TYPE</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482465"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482464"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482463"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482464"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482463"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-1513"></span><span id="local-6989586621679481073"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481073"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="%24"><span class="annot"><span class="annottext">$ :: forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var hs-var">$</span></a></span></span><span> </span><span id="local-6989586621679481072"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481072"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481073"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481072"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1514"></span><span>
</span><span id="line-1515"></span><span class="hs-comment">-- | Strict (call-by-value) application operator. It takes a function and an</span><span>
</span><span id="line-1516"></span><span class="hs-comment">-- argument, evaluates the argument to weak head normal form (WHNF), then calls</span><span>
</span><span id="line-1517"></span><span class="hs-comment">-- the function with that value.</span><span>
</span><span id="line-1518"></span><span>
</span><span id="line-1519"></span><span class="annot"><a href="GHC.Base.html#%24%21"><span class="hs-operator hs-type">($!)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679481071"><span class="annot"><a href="#local-6989586621679481071"><span class="hs-identifier hs-type">r</span></a></span></span><span> </span><span id="local-6989586621679481070"><span class="annot"><a href="#local-6989586621679481070"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679481069"><span class="annot"><a href="#local-6989586621679481069"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#TYPE"><span class="hs-identifier hs-type">TYPE</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481071"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679481070"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481069"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481070"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679481069"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-1520"></span><span id="local-6989586621679481068"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481068"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="%24%21"><span class="annot"><span class="annottext">$! :: forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24%21"><span class="hs-operator hs-var hs-var">$!</span></a></span></span><span> </span><span id="local-6989586621679481067"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481067"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679481066"><span class="annot"><span class="annottext">vx :: a
</span><a href="#local-6989586621679481066"><span class="hs-identifier hs-var hs-var">vx</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481067"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481068"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481066"><span class="hs-identifier hs-var">vx</span></a></span><span>  </span><span class="hs-comment">-- see #2273</span><span>
</span><span id="line-1521"></span><span>
</span><span id="line-1522"></span><span class="hs-comment">-- | @'until' p f@ yields the result of applying @f@ until @p@ holds.</span><span>
</span><span id="line-1523"></span><span id="local-6989586621679482458"><span class="annot"><a href="GHC.Base.html#until"><span class="hs-identifier hs-type">until</span></a></span><span>                   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482458"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679482458"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482458"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482458"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482458"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1524"></span><span id="until"><span class="annot"><span class="annottext">until :: forall a. (a -&gt; Bool) -&gt; (a -&gt; a) -&gt; a -&gt; a
</span><a href="GHC.Base.html#until"><span class="hs-identifier hs-var hs-var">until</span></a></span></span><span> </span><span id="local-6989586621679481064"><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679481064"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679481063"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679481063"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679481062"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-1525"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1526"></span><span>    </span><span id="local-6989586621679481062"><span class="annot"><span class="annottext">go :: a -&gt; a
</span><a href="#local-6989586621679481062"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679481061"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481061"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a -&gt; Bool
</span><a href="#local-6989586621679481064"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481061"><span class="hs-identifier hs-var">x</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481061"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1527"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679481062"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679481063"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481061"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1528"></span><span>
</span><span id="line-1529"></span><span class="hs-comment">-- | 'asTypeOf' is a type-restricted version of 'const'.  It is usually</span><span>
</span><span id="line-1530"></span><span class="hs-comment">-- used as an infix operator, and its typing forces its first argument</span><span>
</span><span id="line-1531"></span><span class="hs-comment">-- (which is usually overloaded) to have the same type as the second.</span><span>
</span><span id="line-1532"></span><span id="local-6989586621679482456"><span class="annot"><a href="GHC.Base.html#asTypeOf"><span class="hs-identifier hs-type">asTypeOf</span></a></span><span>                </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482456"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482456"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679482456"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1533"></span><span id="asTypeOf"><span class="annot"><span class="annottext">asTypeOf :: forall a. a -&gt; a -&gt; a
</span><a href="GHC.Base.html#asTypeOf"><span class="hs-identifier hs-var hs-var">asTypeOf</span></a></span></span><span>                </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span>
</span><span id="line-1534"></span><span>
</span><span id="line-1535"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1536"></span><span class="hs-comment">-- Functor/Applicative/Monad instances for IO</span><span>
</span><span id="line-1537"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1538"></span><span>
</span><span id="line-1539"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1540"></span><span class="hs-keyword">instance</span><span>  </span><span id="local-6989586621679481057"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1541"></span><span>   </span><span id="local-6989586621679481054"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; IO a -&gt; IO b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679481053"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481053"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679481052"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679481052"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679481052"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (a -&gt; IO b) -&gt; IO b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; IO b
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; IO b) -&gt; (a -&gt; b) -&gt; a -&gt; IO b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679481053"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1542"></span><span>
</span><span id="line-1543"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1544"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481044"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1545"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1546"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1547"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#liftA2"><span class="hs-pragma hs-type">liftA2</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1548"></span><span>    </span><span id="local-6989586621679481043"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; IO a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall a. a -&gt; IO a
</span><a href="GHC.Base.html#returnIO"><span class="hs-identifier hs-var">returnIO</span></a></span><span>
</span><span id="line-1549"></span><span>    </span><span id="local-6989586621679481042"><span class="annot"><span class="annottext">*&gt; :: forall a b. IO a -&gt; IO b -&gt; IO b
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(*&gt;)</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO b -&gt; IO b
forall a b. IO a -&gt; IO b -&gt; IO b
</span><a href="GHC.Base.html#thenIO"><span class="hs-identifier hs-var">thenIO</span></a></span><span>
</span><span id="line-1550"></span><span>    </span><span id="local-6989586621679481040"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. IO (a -&gt; b) -&gt; IO a -&gt; IO b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (a -&gt; b) -&gt; IO a -&gt; IO b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span>
</span><span id="line-1551"></span><span>    </span><span id="local-6989586621679481038"><span class="annot"><span class="annottext">liftA2 :: forall a b c. (a -&gt; b -&gt; c) -&gt; IO a -&gt; IO b -&gt; IO c
</span><a href="#local-6989586621679481038"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftA2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; c) -&gt; IO a -&gt; IO b -&gt; IO c
forall (m :: * -&gt; *) a1 a2 r.
Monad m =&gt;
(a1 -&gt; a2 -&gt; r) -&gt; m a1 -&gt; m a2 -&gt; m r
</span><a href="GHC.Base.html#liftM2"><span class="hs-identifier hs-var">liftM2</span></a></span><span>
</span><span id="line-1552"></span><span>
</span><span id="line-1553"></span><span class="hs-comment">-- | @since 2.01</span><span>
</span><span id="line-1554"></span><span class="hs-keyword">instance</span><span>  </span><span id="local-6989586621679481032"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1555"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;</span><span class="hs-pragma">)</span><span>   </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1556"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&gt;&gt;=</span><span class="hs-pragma">)</span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1557"></span><span>    </span><span id="local-6989586621679481030"><span class="annot"><span class="annottext">&gt;&gt; :: forall a b. IO a -&gt; IO b -&gt; IO b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&gt;&gt;)</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO b -&gt; IO b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f b -&gt; f b
</span><a href="GHC.Base.html#%2A%3E"><span class="hs-operator hs-var">(*&gt;)</span></a></span><span>
</span><span id="line-1558"></span><span>    </span><span id="local-6989586621679481029"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. IO a -&gt; (a -&gt; IO b) -&gt; IO b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">(&gt;&gt;=)</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (a -&gt; IO b) -&gt; IO b
forall a b. IO a -&gt; (a -&gt; IO b) -&gt; IO b
</span><a href="GHC.Base.html#bindIO"><span class="hs-identifier hs-var">bindIO</span></a></span><span>
</span><span id="line-1559"></span><span>
</span><span id="line-1560"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-1561"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481021"><span id="local-6989586621679481023"><span class="annot"><a href="GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1562"></span><span>    </span><span id="local-6989586621679481020"><span class="annot"><span class="annottext">empty :: forall a. IO a
</span><a href="#local-6989586621679481020"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO a
forall a. String -&gt; IO a
</span><a href="GHC.Base.html#failIO"><span class="hs-identifier hs-var">failIO</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mzero&quot;</span></span><span>
</span><span id="line-1563"></span><span>    </span><span id="local-6989586621679481018"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. IO a -&gt; IO a -&gt; IO a
</span><a href="#local-6989586621679481018"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;|&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO a -&gt; IO a
forall a. IO a -&gt; IO a -&gt; IO a
</span><a href="GHC.IO.html#mplusIO"><span class="hs-identifier hs-var">mplusIO</span></a></span><span>
</span><span id="line-1564"></span><span>
</span><span id="line-1565"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-1566"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679481010"><span id="local-6989586621679481012"><span class="annot"><a href="GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span></span></span><span>
</span><span id="line-1567"></span><span>
</span><span id="line-1568"></span><span id="local-6989586621679481009"><span class="annot"><a href="GHC.Base.html#returnIO"><span class="hs-identifier hs-type">returnIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679481009"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481009"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1569"></span><span id="returnIO"><span class="annot"><span class="annottext">returnIO :: forall a. a -&gt; IO a
</span><a href="GHC.Base.html#returnIO"><span class="hs-identifier hs-var hs-var">returnIO</span></a></span></span><span> </span><span id="local-6989586621679481008"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481008"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679481007"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679481007"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679481007"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481008"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">#)</span><span class="hs-special">)</span><span>
</span><span id="line-1570"></span><span>
</span><span id="line-1571"></span><span id="local-6989586621679481005"><span id="local-6989586621679481006"><span class="annot"><a href="GHC.Base.html#bindIO"><span class="hs-identifier hs-type">bindIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481006"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679481006"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481005"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679481005"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-1572"></span><span id="bindIO"><span class="annot"><span class="annottext">bindIO :: forall a b. IO a -&gt; (a -&gt; IO b) -&gt; IO b
</span><a href="GHC.Base.html#bindIO"><span class="hs-identifier hs-var hs-var">bindIO</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span id="local-6989586621679481004"><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679481004"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679481003"><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679481003"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, b #)) -&gt; IO b
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679481002"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679481002"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679481004"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679481002"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679481001"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679481001"><span class="hs-identifier hs-var">new_s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679481000"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481000"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO b -&gt; State# RealWorld -&gt; (# State# RealWorld, b #)
forall a. IO a -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="GHC.Base.html#unIO"><span class="hs-identifier hs-var">unIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679481003"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679481000"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679481001"><span class="hs-identifier hs-var">new_s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1573"></span><span>
</span><span id="line-1574"></span><span id="local-6989586621679480997"><span id="local-6989586621679480998"><span class="annot"><a href="GHC.Base.html#thenIO"><span class="hs-identifier hs-type">thenIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480998"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480997"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480997"><span class="hs-identifier hs-type">b</span></a></span></span></span><span>
</span><span id="line-1575"></span><span id="thenIO"><span class="annot"><span class="annottext">thenIO :: forall a b. IO a -&gt; IO b -&gt; IO b
</span><a href="GHC.Base.html#thenIO"><span class="hs-identifier hs-var hs-var">thenIO</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span id="local-6989586621679480996"><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679480996"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679480995"><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679480995"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, b #)) -&gt; IO b
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679480994"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679480994"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679480996"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679480994"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679480993"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679480993"><span class="hs-identifier hs-var">new_s</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO b -&gt; State# RealWorld -&gt; (# State# RealWorld, b #)
forall a. IO a -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="GHC.Base.html#unIO"><span class="hs-identifier hs-var">unIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679480995"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621679480993"><span class="hs-identifier hs-var">new_s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1576"></span><span>
</span><span id="line-1577"></span><span class="hs-comment">-- Note that it is import that we do not SOURCE import this as</span><span>
</span><span id="line-1578"></span><span class="hs-comment">-- its demand signature encodes knowledge of its bottoming</span><span>
</span><span id="line-1579"></span><span class="hs-comment">-- behavior, which can expose useful simplifications. See</span><span>
</span><span id="line-1580"></span><span class="hs-comment">-- #16588.</span><span>
</span><span id="line-1581"></span><span id="local-6989586621679482439"><span class="annot"><a href="GHC.Base.html#failIO"><span class="hs-identifier hs-type">failIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482439"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1582"></span><span id="failIO"><span class="annot"><span class="annottext">failIO :: forall a. String -&gt; IO a
</span><a href="GHC.Base.html#failIO"><span class="hs-identifier hs-var hs-var">failIO</span></a></span></span><span> </span><span id="local-6989586621679480992"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679480992"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-var">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
forall a b. a -&gt; State# RealWorld -&gt; (# State# RealWorld, b #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#raiseIO%23"><span class="hs-identifier hs-var">raiseIO#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SomeException
</span><a href="GHC.IO.html#mkUserError"><span class="hs-identifier hs-var">mkUserError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679480992"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1583"></span><span>
</span><span id="line-1584"></span><span id="local-6989586621679482433"><span class="annot"><a href="GHC.Base.html#unIO"><span class="hs-identifier hs-type">unIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679482433"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#State%23"><span class="hs-identifier hs-type">State#</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#RealWorld"><span class="hs-identifier hs-type">RealWorld</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#State%23"><span class="hs-identifier hs-type">State#</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#RealWorld"><span class="hs-identifier hs-type">RealWorld</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679482433"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">#)</span><span class="hs-special">)</span></span><span>
</span><span id="line-1585"></span><span id="unIO"><span class="annot"><span class="annottext">unIO :: forall a. IO a -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="GHC.Base.html#unIO"><span class="hs-identifier hs-var hs-var">unIO</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span id="local-6989586621679480991"><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679480991"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="#local-6989586621679480991"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-1586"></span><span>
</span><span id="line-1587"></span><span class="hs-comment">{- |
Returns the tag of a constructor application; this function is used
by the deriving code for Eq, Ord and Enum.
-}</span><span>
</span><span id="line-1591"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#getTag"><span class="hs-pragma hs-type">getTag</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1592"></span><span id="local-6989586621679482426"><span class="annot"><a href="GHC.Base.html#getTag"><span class="hs-identifier hs-type">getTag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679482426"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span></span><span>
</span><span id="line-1593"></span><span id="getTag"><span class="annot"><span class="annottext">getTag :: forall a. a -&gt; Int#
</span><a href="GHC.Base.html#getTag"><span class="hs-identifier hs-var hs-var">getTag</span></a></span></span><span> </span><span id="local-6989586621679480989"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679480989"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Int#
forall a. a -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#dataToTag%23"><span class="hs-identifier hs-var">dataToTag#</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679480989"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1594"></span><span>
</span><span id="line-1595"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1596"></span><span class="hs-comment">-- Numeric primops</span><span>
</span><span id="line-1597"></span><span class="hs-comment">----------------------------------------------</span><span>
</span><span id="line-1598"></span><span>
</span><span id="line-1599"></span><span class="hs-comment">-- Definitions of the boxed PrimOps; these will be</span><span>
</span><span id="line-1600"></span><span class="hs-comment">-- used in the case of partial applications, etc.</span><span>
</span><span id="line-1601"></span><span>
</span><span id="line-1602"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#quotInt"><span class="hs-pragma hs-type">quotInt</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1603"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Base.html#remInt"><span class="hs-pragma hs-type">remInt</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1604"></span><span>
</span><span id="line-1605"></span><span class="annot"><a href="GHC.Base.html#quotInt"><span class="hs-identifier hs-type">quotInt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#remInt"><span class="hs-identifier hs-type">remInt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#divInt"><span class="hs-identifier hs-type">divInt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#modInt"><span class="hs-identifier hs-type">modInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-1606"></span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480984"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480984"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="quotInt"><span class="annot"><span class="annottext">quotInt :: Int -&gt; Int -&gt; Int
</span><a href="GHC.Base.html#quotInt"><span class="hs-operator hs-var hs-var">`quotInt`</span></a></span></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480983"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480983"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480984"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#quotInt%23"><span class="hs-operator hs-var">`quotInt#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480983"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1607"></span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480982"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480982"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="remInt"><span class="annot"><span class="annottext">remInt :: Int -&gt; Int -&gt; Int
</span><a href="GHC.Base.html#remInt"><span class="hs-operator hs-var hs-var">`remInt`</span></a></span></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480981"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480981"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480982"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#remInt%23"><span class="hs-operator hs-var">`remInt#`</span></a></span><span>  </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480981"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1608"></span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480980"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480980"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="divInt"><span class="annot"><span class="annottext">divInt :: Int -&gt; Int -&gt; Int
</span><a href="GHC.Base.html#divInt"><span class="hs-operator hs-var hs-var">`divInt`</span></a></span></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480979"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480979"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480980"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Classes.html#divInt%23"><span class="hs-operator hs-var">`divInt#`</span></a></span><span>  </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480979"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1609"></span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480978"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480978"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="modInt"><span class="annot"><span class="annottext">modInt :: Int -&gt; Int -&gt; Int
</span><a href="GHC.Base.html#modInt"><span class="hs-operator hs-var hs-var">`modInt`</span></a></span></span><span>   </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480977"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480977"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480978"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Classes.html#modInt%23"><span class="hs-operator hs-var">`modInt#`</span></a></span><span>  </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480977"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1610"></span><span>
</span><span id="line-1611"></span><span class="annot"><a href="GHC.Base.html#quotRemInt"><span class="hs-identifier hs-type">quotRemInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1612"></span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480975"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480975"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="quotRemInt"><span class="annot"><span class="annottext">quotRemInt :: Int -&gt; Int -&gt; (Int, Int)
</span><a href="GHC.Base.html#quotRemInt"><span class="hs-operator hs-var hs-var">`quotRemInt`</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480974"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480974"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480975"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; (# Int#, Int# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#quotRemInt%23"><span class="hs-operator hs-var">`quotRemInt#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480974"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1613"></span><span>                             </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679480973"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480973"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679480972"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480972"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1614"></span><span>                                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480973"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480972"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1615"></span><span>
</span><span id="line-1616"></span><span class="annot"><a href="GHC.Base.html#divModInt"><span class="hs-identifier hs-type">divModInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1617"></span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480970"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480970"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="divModInt"><span class="annot"><span class="annottext">divModInt :: Int -&gt; Int -&gt; (Int, Int)
</span><a href="GHC.Base.html#divModInt"><span class="hs-operator hs-var hs-var">`divModInt`</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480969"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480969"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480970"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; (# Int#, Int# #)
</span><a href="GHC.Base.html#divModInt%23"><span class="hs-operator hs-var">`divModInt#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480969"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1618"></span><span>                            </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679480967"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480967"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679480966"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480966"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480967"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480966"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1619"></span><span>
</span><span id="line-1620"></span><span class="annot"><a href="GHC.Base.html#divModInt%23"><span class="hs-identifier hs-type">divModInt#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-1621"></span><span id="local-6989586621679480965"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480965"><span class="hs-identifier hs-var">x#</span></a></span></span><span> </span><span id="divModInt%23"><span class="annot"><span class="annottext">divModInt# :: Int# -&gt; Int# -&gt; (# Int#, Int# #)
</span><a href="GHC.Base.html#divModInt%23"><span class="hs-operator hs-var hs-var">`divModInt#`</span></a></span></span><span> </span><span id="local-6989586621679480964"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span></span><span>
</span><span id="line-1622"></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480965"><span class="hs-identifier hs-var">x#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3E%23"><span class="hs-operator hs-var">&gt;#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3C%23"><span class="hs-operator hs-var">&lt;#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1623"></span><span>                                    </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480965"><span class="hs-identifier hs-var">x#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#-%23"><span class="hs-operator hs-var">-#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; (# Int#, Int# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#quotRemInt%23"><span class="hs-operator hs-var">`quotRemInt#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1624"></span><span>                                      </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679480962"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480962"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679480961"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480961"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480962"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#-%23"><span class="hs-operator hs-var">-#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480961"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-1625"></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480965"><span class="hs-identifier hs-var">x#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3C%23"><span class="hs-operator hs-var">&lt;#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3E%23"><span class="hs-operator hs-var">&gt;#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1626"></span><span>                                    </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480965"><span class="hs-identifier hs-var">x#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; (# Int#, Int# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#quotRemInt%23"><span class="hs-operator hs-var">`quotRemInt#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1627"></span><span>                                      </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679480960"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480960"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679480959"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480959"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480960"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#-%23"><span class="hs-operator hs-var">-#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480959"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%2B%23"><span class="hs-operator hs-var">+#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#-%23"><span class="hs-operator hs-var">-#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-1628"></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                                </span><span class="hs-glyph">=</span><span>
</span><span id="line-1629"></span><span>                                    </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480965"><span class="hs-identifier hs-var">x#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; (# Int#, Int# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#quotRemInt%23"><span class="hs-operator hs-var">`quotRemInt#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480964"><span class="hs-identifier hs-var">y#</span></a></span><span>
</span><span id="line-1630"></span><span>
</span><span id="line-1631"></span><span class="hs-comment">-- Wrappers for the shift operations.  The uncheckedShift# family are</span><span>
</span><span id="line-1632"></span><span class="hs-comment">-- undefined when the amount being shifted by is greater than the size</span><span>
</span><span id="line-1633"></span><span class="hs-comment">-- in bits of Int#, so these wrappers perform a check and return</span><span>
</span><span id="line-1634"></span><span class="hs-comment">-- either zero or -1 appropriately.</span><span>
</span><span id="line-1635"></span><span class="hs-comment">--</span><span>
</span><span id="line-1636"></span><span class="hs-comment">-- Note that these wrappers still produce undefined results when the</span><span>
</span><span id="line-1637"></span><span class="hs-comment">-- second argument (the shift amount) is negative.</span><span>
</span><span id="line-1638"></span><span>
</span><span id="line-1639"></span><span class="hs-comment">-- | Shift the argument left by the specified number of bits</span><span>
</span><span id="line-1640"></span><span class="hs-comment">-- (which must be non-negative).</span><span>
</span><span id="line-1641"></span><span class="annot"><a href="GHC.Base.html#shiftL%23"><span class="hs-identifier hs-type">shiftL#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Word%23"><span class="hs-identifier hs-type">Word#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Word%23"><span class="hs-identifier hs-type">Word#</span></a></span><span>
</span><span id="line-1642"></span><span id="local-6989586621679480957"><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480957"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="shiftL%23"><span class="annot"><span class="annottext">shiftL# :: Word# -&gt; Int# -&gt; Word#
</span><a href="GHC.Base.html#shiftL%23"><span class="hs-operator hs-var hs-var">`shiftL#`</span></a></span></span><span> </span><span id="local-6989586621679480956"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480956"><span class="hs-identifier hs-var">b</span></a></span></span><span>   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480956"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3E%3D%23"><span class="hs-operator hs-var">&gt;=#</span></a></span><span> </span><span class="hs-identifier">WORD_SIZE_IN_BITS#</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">0##</span><span>
</span><span id="line-1643"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480957"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int# -&gt; Word#
</span><a href="../../ghc-prim/src/GHC.Prim.html#uncheckedShiftL%23"><span class="hs-operator hs-var">`uncheckedShiftL#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480956"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1644"></span><span>
</span><span id="line-1645"></span><span class="hs-comment">-- | Shift the argument right by the specified number of bits</span><span>
</span><span id="line-1646"></span><span class="hs-comment">-- (which must be non-negative).</span><span>
</span><span id="line-1647"></span><span class="hs-comment">-- The &quot;RL&quot; means &quot;right, logical&quot; (as opposed to RA for arithmetic)</span><span>
</span><span id="line-1648"></span><span class="hs-comment">-- (although an arithmetic right shift wouldn't make sense for Word#)</span><span>
</span><span id="line-1649"></span><span class="annot"><a href="GHC.Base.html#shiftRL%23"><span class="hs-identifier hs-type">shiftRL#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Word%23"><span class="hs-identifier hs-type">Word#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Word%23"><span class="hs-identifier hs-type">Word#</span></a></span><span>
</span><span id="line-1650"></span><span id="local-6989586621679480954"><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480954"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="shiftRL%23"><span class="annot"><span class="annottext">shiftRL# :: Word# -&gt; Int# -&gt; Word#
</span><a href="GHC.Base.html#shiftRL%23"><span class="hs-operator hs-var hs-var">`shiftRL#`</span></a></span></span><span> </span><span id="local-6989586621679480953"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480953"><span class="hs-identifier hs-var">b</span></a></span></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480953"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3E%3D%23"><span class="hs-operator hs-var">&gt;=#</span></a></span><span> </span><span class="hs-identifier">WORD_SIZE_IN_BITS#</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">0##</span><span>
</span><span id="line-1651"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480954"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Int# -&gt; Word#
</span><a href="../../ghc-prim/src/GHC.Prim.html#uncheckedShiftRL%23"><span class="hs-operator hs-var">`uncheckedShiftRL#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480953"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1652"></span><span>
</span><span id="line-1653"></span><span class="hs-comment">-- | Shift the argument left by the specified number of bits</span><span>
</span><span id="line-1654"></span><span class="hs-comment">-- (which must be non-negative).</span><span>
</span><span id="line-1655"></span><span class="annot"><a href="GHC.Base.html#iShiftL%23"><span class="hs-identifier hs-type">iShiftL#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span>
</span><span id="line-1656"></span><span id="local-6989586621679480951"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480951"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="iShiftL%23"><span class="annot"><span class="annottext">iShiftL# :: Int# -&gt; Int# -&gt; Int#
</span><a href="GHC.Base.html#iShiftL%23"><span class="hs-operator hs-var hs-var">`iShiftL#`</span></a></span></span><span> </span><span id="local-6989586621679480950"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480950"><span class="hs-identifier hs-var">b</span></a></span></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480950"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3E%3D%23"><span class="hs-operator hs-var">&gt;=#</span></a></span><span> </span><span class="hs-identifier">WORD_SIZE_IN_BITS#</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">0#</span><span>
</span><span id="line-1657"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480951"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#uncheckedIShiftL%23"><span class="hs-operator hs-var">`uncheckedIShiftL#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480950"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1658"></span><span>
</span><span id="line-1659"></span><span class="hs-comment">-- | Shift the argument right (signed) by the specified number of bits</span><span>
</span><span id="line-1660"></span><span class="hs-comment">-- (which must be non-negative).</span><span>
</span><span id="line-1661"></span><span class="hs-comment">-- The &quot;RA&quot; means &quot;right, arithmetic&quot; (as opposed to RL for logical)</span><span>
</span><span id="line-1662"></span><span class="annot"><a href="GHC.Base.html#iShiftRA%23"><span class="hs-identifier hs-type">iShiftRA#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span>
</span><span id="line-1663"></span><span id="local-6989586621679480948"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480948"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="iShiftRA%23"><span class="annot"><span class="annottext">iShiftRA# :: Int# -&gt; Int# -&gt; Int#
</span><a href="GHC.Base.html#iShiftRA%23"><span class="hs-operator hs-var hs-var">`iShiftRA#`</span></a></span></span><span> </span><span id="local-6989586621679480947"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480947"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480947"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3E%3D%23"><span class="hs-operator hs-var">&gt;=#</span></a></span><span> </span><span class="hs-identifier">WORD_SIZE_IN_BITS#</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">isTrue#</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">a</span><span> </span><span class="hs-operator">&lt;#</span><span> </span><span class="hs-number">0#</span><span class="hs-special">)</span><span>
</span><span id="line-1664"></span><span>                                                          </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">(</span><span class="hs-number">-1#</span><span class="hs-special">)</span><span>
</span><span id="line-1665"></span><span>                                                          </span><span class="hs-keyword">else</span><span> </span><span class="hs-number">0#</span><span>
</span><span id="line-1666"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480948"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#uncheckedIShiftRA%23"><span class="hs-operator hs-var">`uncheckedIShiftRA#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480947"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1667"></span><span>
</span><span id="line-1668"></span><span class="hs-comment">-- | Shift the argument right (unsigned) by the specified number of bits</span><span>
</span><span id="line-1669"></span><span class="hs-comment">-- (which must be non-negative).</span><span>
</span><span id="line-1670"></span><span class="hs-comment">-- The &quot;RL&quot; means &quot;right, logical&quot; (as opposed to RA for arithmetic)</span><span>
</span><span id="line-1671"></span><span class="annot"><a href="GHC.Base.html#iShiftRL%23"><span class="hs-identifier hs-type">iShiftRL#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span>
</span><span id="line-1672"></span><span id="local-6989586621679480945"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480945"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="iShiftRL%23"><span class="annot"><span class="annottext">iShiftRL# :: Int# -&gt; Int# -&gt; Int#
</span><a href="GHC.Base.html#iShiftRL%23"><span class="hs-operator hs-var hs-var">`iShiftRL#`</span></a></span></span><span> </span><span id="local-6989586621679480944"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480944"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#isTrue%23"><span class="hs-identifier hs-var">isTrue#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480944"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#%3E%3D%23"><span class="hs-operator hs-var">&gt;=#</span></a></span><span> </span><span class="hs-identifier">WORD_SIZE_IN_BITS#</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">0#</span><span>
</span><span id="line-1673"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480945"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#uncheckedIShiftRL%23"><span class="hs-operator hs-var">`uncheckedIShiftRL#`</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480944"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1674"></span><span>
</span><span id="line-1675"></span><span class="hs-comment">-- Rules for C strings (the functions themselves are now in GHC.CString)</span><span>
</span><span id="line-1676"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1677"></span><span class="annot"><span class="hs-pragma">&quot;unpack&quot;</span></span><span>       </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679480943"><span class="annot"><a href="#local-6989586621679480943"><span class="hs-pragma hs-var">a</span></a></span></span><span>   </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480943"><span class="hs-pragma hs-type">a</span></a></span><span>             </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackFoldrCString%23"><span class="hs-pragma hs-type">unpackFoldrCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480943"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-1678"></span><span class="annot"><span class="hs-pragma">&quot;unpack-list&quot;</span></span><span>  </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span>  </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679480942"><span class="annot"><a href="#local-6989586621679480942"><span class="hs-pragma hs-var">a</span></a></span></span><span>   </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackFoldrCString%23"><span class="hs-pragma hs-type">unpackFoldrCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480942"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">:</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480942"><span class="hs-pragma hs-type">a</span></a></span><span>
</span><span id="line-1679"></span><span class="annot"><span class="hs-pragma">&quot;unpack-append&quot;</span></span><span>     </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679480941"><span class="annot"><a href="#local-6989586621679480941"><span class="hs-pragma hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679480940"><span class="annot"><a href="#local-6989586621679480940"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackFoldrCString%23"><span class="hs-pragma hs-type">unpackFoldrCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480941"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">:</span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679480940"><span class="hs-pragma hs-type">n</span></a></span><span>  </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackAppendCString%23"><span class="hs-pragma hs-type">unpackAppendCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480941"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480940"><span class="hs-pragma hs-type">n</span></a></span><span>
</span><span id="line-1680"></span><span>
</span><span id="line-1681"></span><span class="annot"><span class="hs-pragma">&quot;unpack-utf8&quot;</span></span><span>       </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679480938"><span class="annot"><a href="#local-6989586621679480938"><span class="hs-pragma hs-var">a</span></a></span></span><span>   </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-pragma hs-type">unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480938"><span class="hs-pragma hs-type">a</span></a></span><span>             </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Base.html#build"><span class="hs-pragma hs-type">build</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackFoldrCStringUtf8%23"><span class="hs-pragma hs-type">unpackFoldrCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480938"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-1682"></span><span class="annot"><span class="hs-pragma">&quot;unpack-list-utf8&quot;</span></span><span>  </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span>  </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679480937"><span class="annot"><a href="#local-6989586621679480937"><span class="hs-pragma hs-var">a</span></a></span></span><span>   </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackFoldrCStringUtf8%23"><span class="hs-pragma hs-type">unpackFoldrCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480937"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">:</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-pragma hs-type">unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480937"><span class="hs-pragma hs-type">a</span></a></span><span>
</span><span id="line-1683"></span><span class="annot"><span class="hs-pragma">&quot;unpack-append-utf8&quot;</span></span><span>     </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679480936"><span class="annot"><a href="#local-6989586621679480936"><span class="hs-pragma hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679480935"><span class="annot"><a href="#local-6989586621679480935"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackFoldrCStringUtf8%23"><span class="hs-pragma hs-type">unpackFoldrCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480936"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">:</span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679480935"><span class="hs-pragma hs-type">n</span></a></span><span>  </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackAppendCStringUtf8%23"><span class="hs-pragma hs-type">unpackAppendCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480936"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679480935"><span class="hs-pragma hs-type">n</span></a></span><span>
</span><span id="line-1684"></span><span>
</span><span id="line-1685"></span><span class="hs-pragma">-- There's a built-in rule (in GHC.Core.Op.ConstantFold) for</span><span>
</span><span id="line-1686"></span><span class="hs-pragma">--      unpackFoldr &quot;foo&quot; c (unpackFoldr &quot;baz&quot; c n)  =  unpackFoldr &quot;foobaz&quot; c n</span><span>
</span><span id="line-1687"></span><span>
</span><span id="line-1688"></span><span class="hs-pragma">-- See also the Note [String literals in GHC] in CString.hs</span><span>
</span><span id="line-1689"></span><span>
</span><span id="line-1690"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1691"></span></pre></body></html>